Class: Stat
- Inherits:
-
Object
- Object
- Stat
- Defined in:
- lib/sightstone/stat.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ Stat
constructor
A new instance of Stat.
Constructor Details
#initialize(data) ⇒ Stat
Returns a new instance of Stat.
4 5 6 7 8 9 10 11 12 |
# File 'lib/sightstone/stat.rb', line 4 def initialize(data) @id = data['id'] @name = data['name'] @value = if data.has_key? 'value' data['value'] else data['count'] end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/sightstone/stat.rb', line 2 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/sightstone/stat.rb', line 2 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
2 3 4 |
# File 'lib/sightstone/stat.rb', line 2 def value @value end |