Class: Sightstone

Inherits:
Object
  • Object
show all
Defined in:
lib/sightstone.rb

Overview

This is the main class of the Sightstone gem. All calls should be perfomrmed through this class.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Sightstone) initialize(api_key, region = 'euw')

Returns a new instance of Sightstone

Parameters:

  • api_key (String)

    Riot developer api key

  • region (String) (defaults to: 'euw')

    The default region to be used. See riots dev. page for supported regions.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/sightstone.rb', line 27

def initialize(api_key, region='euw')
  @api_key = api_key
  @region = region
  
  @summoner = SummonerModule.new(self)
  @champion = ChampionModule.new(self)
  @game = GameModule.new(self)
  @league = LeagueModule.new(self)
  @stats = StatsModule.new(self)
  @team = TeamModule.new(self)
end

Instance Attribute Details

- (String) api_key

Your api key

Returns:

  • (String)

    the current value of api_key



19
20
21
# File 'lib/sightstone.rb', line 19

def api_key
  @api_key
end

- (Object) champion

Returns the value of attribute champion



23
24
25
# File 'lib/sightstone.rb', line 23

def champion
  @champion
end

- (ChampionModule) Champion

module to call the champion api

Returns:

  • (ChampionModule)

    the current value of Champion



19
20
21
# File 'lib/sightstone.rb', line 19

def Champion
  @Champion
end

- (Object) game

Returns the value of attribute game



23
24
25
# File 'lib/sightstone.rb', line 23

def game
  @game
end

- (GameModule) Game

module to call the game api

Returns:



19
20
21
# File 'lib/sightstone.rb', line 19

def Game
  @Game
end

- (LeagueModule) League

module to call the leagues api

Returns:



19
20
21
# File 'lib/sightstone.rb', line 19

def League
  @League
end

- (Object) league

Returns the value of attribute league



23
24
25
# File 'lib/sightstone.rb', line 23

def league
  @league
end

- (String) region

The default region

Returns:

  • (String)

    the current value of region



19
20
21
# File 'lib/sightstone.rb', line 19

def region
  @region
end

- (Object) stats

Returns the value of attribute stats



23
24
25
# File 'lib/sightstone.rb', line 23

def stats
  @stats
end

- (StatsModule) Stats

module to call the stats api

Returns:

  • (StatsModule)

    the current value of Stats



19
20
21
# File 'lib/sightstone.rb', line 19

def Stats
  @Stats
end

- (SummonerModule) summoner

Module to call the summoners api

Returns:



19
20
21
# File 'lib/sightstone.rb', line 19

def summoner
  @summoner
end

- (TeamModule) Team

module to call the team api

Returns:



19
20
21
# File 'lib/sightstone.rb', line 19

def Team
  @Team
end

- (Object) team

Returns the value of attribute team



23
24
25
# File 'lib/sightstone.rb', line 23

def team
  @team
end