Class: Summoner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject (readonly)

Returns the value of attribute api_key.



12
13
14
# File 'lib/LoLStat/Summoner.rb', line 12

def api_key
  @api_key
end

#dataObject (readonly)

Returns the value of attribute data.



12
13
14
# File 'lib/LoLStat/Summoner.rb', line 12

def data
  @data
end

#summonerIdObject (readonly)

Returns the value of attribute summonerId.



12
13
14
# File 'lib/LoLStat/Summoner.rb', line 12

def summonerId
  @summonerId
end

#summonerNameObject (readonly)

Returns the value of attribute summonerName.



12
13
14
# File 'lib/LoLStat/Summoner.rb', line 12

def summonerName
  @summonerName
end

Instance Method Details

#leaguesObject



29
30
31
# File 'lib/LoLStat/Summoner.rb', line 29

def leagues()
	return Leagues.new(@summonerId, @api_key)
end

#masteriesObject



38
39
40
# File 'lib/LoLStat/Summoner.rb', line 38

def masteries()
	return Masteries.new(@summonerId, @api_key)
end

#profileIconIdObject



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

def profileIconId()
	@data["profileIconId"]
end

#rankedStatsObject



35
36
37
# File 'lib/LoLStat/Summoner.rb', line 35

def rankedStats()
	return RankedStats.new(@summonerId, @api_key)
end

#recentGamesObject



26
27
28
# File 'lib/LoLStat/Summoner.rb', line 26

def recentGames()
	return RecentGames.new(@summonerId, @api_key)
end

#runesObject



41
42
43
# File 'lib/LoLStat/Summoner.rb', line 41

def runes()
	return Runes.new(@summonerId, @api_key)
end

#statsObject



32
33
34
# File 'lib/LoLStat/Summoner.rb', line 32

def stats()
	return Stats.new(@summonerId, @api_key)
end

#summonerLevelObject



22
23
24
# File 'lib/LoLStat/Summoner.rb', line 22

def summonerLevel()
	@data["summonerLevel"]
end

#teamsObject



44
45
46
# File 'lib/LoLStat/Summoner.rb', line 44

def teams()
	return Teams.new(@summonerId, @api_key)
end