initial commit
This commit is contained in:
18
lib/sightstone/champion.rb
Normal file
18
lib/sightstone/champion.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class Champion
|
||||
attr_accessor :active, :attackRank, :botEnabled, :botMmEnabled
|
||||
attr_accessor :defenseRank, :difficultyRank, :freeToPlay, :id, :magicRank, :name, :rankedPlayEnabled
|
||||
|
||||
def initialize(data)
|
||||
@active = data['active']
|
||||
@attackRank = data['attackRank']
|
||||
@botEnabled = data['botEnabled']
|
||||
@defenseRank = data['defenseRank']
|
||||
@difficultyRank = data['difficultyRank']
|
||||
@freeToPlay = data['freeToPlay']
|
||||
@id = data['id']
|
||||
@magicRank = data['magicRank']
|
||||
@name = data['name']
|
||||
@rankedPlayEnabled = data['rankedPlayEnabled']
|
||||
end
|
||||
|
||||
end
|
||||
36
lib/sightstone/masterybook.rb
Normal file
36
lib/sightstone/masterybook.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
class MasteryBook
|
||||
attr_accessor :pages, :summonerId
|
||||
|
||||
def initialize(data)
|
||||
@summonerId = data['summonerId']
|
||||
@pages = []
|
||||
data['pages'].each do |page|
|
||||
@pages << MasteryPage.new(page)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class MasteryPage
|
||||
attr_accessor :id, :talents, :name, :current
|
||||
|
||||
def initialize(data)
|
||||
@id = data['id']
|
||||
@name = data['name']
|
||||
@current = data['current']
|
||||
@talents = []
|
||||
data['talents'].each do |talent|
|
||||
@talents << Talent.new(talent)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Talent
|
||||
attr_accessor :id,:rank, :name
|
||||
|
||||
def initialize(data)
|
||||
@id = data['id']
|
||||
@name = data['name']
|
||||
@rank = data['rank']
|
||||
end
|
||||
end
|
||||
37
lib/sightstone/runebook.rb
Normal file
37
lib/sightstone/runebook.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
class RuneBook
|
||||
attr_accessor :pages, :summonerId
|
||||
|
||||
def initialize(data)
|
||||
@summonerId = data['summonerId']
|
||||
@pages = []
|
||||
data['pages'].each do |page|
|
||||
@pages << RunePage.new(page)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class RunePage
|
||||
attr_accessor :id, :slots, :name, :current
|
||||
|
||||
def initialize(data)
|
||||
@id = data['id']
|
||||
@name = data['name']
|
||||
@current = data['current']
|
||||
@slots = {}
|
||||
data['slots'].each do |slot|
|
||||
@slots[slot['runeSlotId']] = Rune.new(slot['rune'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Rune
|
||||
attr_accessor :id, :description, :name, :tier
|
||||
|
||||
def initialize(data)
|
||||
@id = data['id']
|
||||
@description = data['description']
|
||||
@name = data['name']
|
||||
@tier = data['tier']
|
||||
end
|
||||
end
|
||||
16
lib/sightstone/summoner.rb
Normal file
16
lib/sightstone/summoner.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
class Summoner
|
||||
|
||||
attr_accessor :name, :id, :profile_icon_id, :revision_date, :level
|
||||
|
||||
def initialize(data)
|
||||
@name = data['name']
|
||||
@id = data['id']
|
||||
@profile_icon_id = data['profileIconId']
|
||||
@revision_date = data['revisionDate']
|
||||
@level = data['summonerLevel']
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user