Class: RiotKit::Models::DataDragon::SummonerSpell
- Inherits:
-
Object
- Object
- RiotKit::Models::DataDragon::SummonerSpell
- Defined in:
- lib/riot_kit/models/data_dragon/summoner_spell.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_full ⇒ Object
readonly
Returns the value of attribute image_full.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, name:, description: '', image_full: '') ⇒ SummonerSpell
constructor
A new instance of SummonerSpell.
- #to_h ⇒ Object
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
#description ⇒ Object (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 |
#id ⇒ Object (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_full ⇒ Object (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 |
#name ⇒ Object (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_h ⇒ Object
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 |