class RiotAPI::MasteryPage
Attributes
talents[R]
Public Class Methods
find(region, summoner_id)
click to toggle source
# File lib/riot_api/mastery_page.rb, line 16 def self.find(region, summoner_id) response = RiotAPI::Client.get(region, "summoner/#{summoner_id}/masteries") response["pages"].map do |data| RiotAPI::MasteryPage.new(data) end end
new(data)
click to toggle source
# File lib/riot_api/mastery_page.rb, line 4 def initialize(data) data.each do |key, value| key = key.underscore if key == "talents" self.talents = value else self.class.send(:attr_accessor, key.to_sym) instance_variable_set("@#{key}", value) end end end
Public Instance Methods
talents=(value)
click to toggle source
# File lib/riot_api/mastery_page.rb, line 23 def talents=(value) @talents = {} value.each do |talent| @talents[talent["id"]] = Talent.new(talent) end end