Class: LolApi::MasteryPage

Inherits:
Object
  • Object
show all
Defined in:
lib/lol_api/types/summoner_masteries.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_page) ⇒ MasteryPage

Returns a new instance of MasteryPage.



26
27
28
# File 'lib/lol_api/types/summoner_masteries.rb', line 26

def initialize(raw_page)
	@raw_page = raw_page
end

Instance Attribute Details

#raw_pageObject (readonly)

Returns the value of attribute raw_page.



24
25
26
# File 'lib/lol_api/types/summoner_masteries.rb', line 24

def raw_page
  @raw_page
end

Instance Method Details

#currentObject



30
31
32
# File 'lib/lol_api/types/summoner_masteries.rb', line 30

def current
	raw_page['current']
end

#idObject



34
35
36
# File 'lib/lol_api/types/summoner_masteries.rb', line 34

def id 
	raw_page['id']
end

#masteriesObject



38
39
40
41
42
43
44
# File 'lib/lol_api/types/summoner_masteries.rb', line 38

def masteries
	if masteries = raw_page['masteries']
		masteries.map do |mastery|
			MasteryItem.new(mastery)
		end
	end
end

#nameObject



46
47
48
# File 'lib/lol_api/types/summoner_masteries.rb', line 46

def name 
	raw_page['name']
end