Class: Summoner
- Inherits:
-
Object
- Object
- Summoner
- Defined in:
- lib/LoLStat/Summoner.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#summonerId ⇒ Object
readonly
Returns the value of attribute summonerId.
-
#summonerName ⇒ Object
readonly
Returns the value of attribute summonerName.
Instance Method Summary collapse
-
#initialize(summoner, api_key) ⇒ Summoner
constructor
A new instance of Summoner.
- #leagues ⇒ Object
- #masteries ⇒ Object
- #profileIconId ⇒ Object
- #rankedStats ⇒ Object
- #recentGames ⇒ Object
- #runes ⇒ Object
- #stats ⇒ Object
- #summonerLevel ⇒ Object
- #teams ⇒ Object
Constructor Details
#initialize(summoner, api_key) ⇒ Summoner
Returns a new instance of Summoner.
13 14 15 16 17 18 |
# File 'lib/LoLStat/Summoner.rb', line 13 def initialize(summoner, api_key) @api_key = api_key @data = summoner @summonerId = summoner["id"] @summonerName = summoner["name"] end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
12 13 14 |
# File 'lib/LoLStat/Summoner.rb', line 12 def api_key @api_key end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
12 13 14 |
# File 'lib/LoLStat/Summoner.rb', line 12 def data @data end |
#summonerId ⇒ Object (readonly)
Returns the value of attribute summonerId.
12 13 14 |
# File 'lib/LoLStat/Summoner.rb', line 12 def summonerId @summonerId end |
#summonerName ⇒ Object (readonly)
Returns the value of attribute summonerName.
12 13 14 |
# File 'lib/LoLStat/Summoner.rb', line 12 def summonerName @summonerName end |
Instance Method Details
#leagues ⇒ Object
29 30 31 |
# File 'lib/LoLStat/Summoner.rb', line 29 def leagues() return Leagues.new(@summonerId, @api_key) end |
#masteries ⇒ Object
38 39 40 |
# File 'lib/LoLStat/Summoner.rb', line 38 def masteries() return Masteries.new(@summonerId, @api_key) end |
#profileIconId ⇒ Object
19 20 21 |
# File 'lib/LoLStat/Summoner.rb', line 19 def profileIconId() @data["profileIconId"] end |
#rankedStats ⇒ Object
35 36 37 |
# File 'lib/LoLStat/Summoner.rb', line 35 def rankedStats() return RankedStats.new(@summonerId, @api_key) end |
#recentGames ⇒ Object
26 27 28 |
# File 'lib/LoLStat/Summoner.rb', line 26 def recentGames() return RecentGames.new(@summonerId, @api_key) end |
#runes ⇒ Object
41 42 43 |
# File 'lib/LoLStat/Summoner.rb', line 41 def runes() return Runes.new(@summonerId, @api_key) end |
#stats ⇒ Object
32 33 34 |
# File 'lib/LoLStat/Summoner.rb', line 32 def stats() return Stats.new(@summonerId, @api_key) end |
#summonerLevel ⇒ Object
22 23 24 |
# File 'lib/LoLStat/Summoner.rb', line 22 def summonerLevel() @data["summonerLevel"] end |