Class: RiotKit::Models::DataDragon::Rune
- Inherits:
-
Object
- Object
- RiotKit::Models::DataDragon::Rune
- Defined in:
- lib/riot_kit/models/data_dragon/rune.rb
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#long_desc ⇒ Object
readonly
Returns the value of attribute long_desc.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#short_desc ⇒ Object
readonly
Returns the value of attribute short_desc.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, name:, short_desc: '', long_desc: '', icon: '') ⇒ Rune
constructor
A new instance of Rune.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, name:, short_desc: '', long_desc: '', icon: '') ⇒ Rune
Returns a new instance of Rune.
9 10 11 12 13 14 15 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 9 def initialize(id:, name:, short_desc: '', long_desc: '', icon: '') @id = id @name = name @short_desc = short_desc @long_desc = long_desc @icon = icon end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
7 8 9 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 7 def icon @icon end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 7 def id @id end |
#long_desc ⇒ Object (readonly)
Returns the value of attribute long_desc.
7 8 9 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 7 def long_desc @long_desc end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 7 def name @name end |
#short_desc ⇒ Object (readonly)
Returns the value of attribute short_desc.
7 8 9 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 7 def short_desc @short_desc end |
Class Method Details
.from_hash(hash) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 17 def self.from_hash(hash) symbolized = RiotKit::Util::Symbolize.deep_symbolize_keys(hash) new( id: symbolized[:id].to_i, name: symbolized[:name].to_s, short_desc: symbolized[:short_desc].to_s, long_desc: symbolized[:long_desc].to_s, icon: symbolized[:icon].to_s ) end |
Instance Method Details
#to_h ⇒ Object
28 29 30 |
# File 'lib/riot_kit/models/data_dragon/rune.rb', line 28 def to_h { id: id, name: name, short_desc: short_desc, long_desc: long_desc, icon: icon } end |