initial commit

This commit is contained in:
danijoo
2013-12-13 09:10:40 +01:00
commit 16f738c060
10 changed files with 641 additions and 0 deletions

View 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

View 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

View 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

View 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