Class: RiotKit::Models::DataDragon::SummonerSpell

Inherits:
Object
  • Object
show all
Defined in:
lib/riot_kit/models/data_dragon/summoner_spell.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, description: '', image_full: '') ⇒ SummonerSpell

Returns a new instance of SummonerSpell.



9
10
11
12
13
14
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 9

def initialize(id:, name:, description: '', image_full: '')
  @id = id
  @name = name
  @description = description
  @image_full = image_full
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



7
8
9
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 7

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 7

def id
  @id
end

#image_fullObject (readonly)

Returns the value of attribute image_full.



7
8
9
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 7

def image_full
  @image_full
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 7

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 16

def self.from_hash(hash)
  symbolized = RiotKit::Util::Symbolize.deep_symbolize_keys(hash)
  new(
    id: symbolized[:id].to_i,
    name: symbolized[:name].to_s,
    description: symbolized[:description].to_s,
    image_full: symbolized[:image_full].to_s
  )
end

Instance Method Details

#to_hObject



26
27
28
# File 'lib/riot_kit/models/data_dragon/summoner_spell.rb', line 26

def to_h
  { id: id, name: name, description: description, image_full: image_full }
end