Class: Stat
- Inherits:
-
Object
- Object
- Stat
- Defined in:
- lib/sightstone/stat.rb
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) id
Returns the value of attribute id.
-
- (Object) name
Returns the value of attribute name.
-
- (Object) value
Returns the value of attribute value.
Instance Method Summary (collapse)
-
- (Stat) initialize(data)
constructor
A new instance of Stat.
Constructor Details
- (Stat) initialize(data)
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
- (Object) id
Returns the value of attribute id
2 3 4 |
# File 'lib/sightstone/stat.rb', line 2 def id @id end |
- (Object) name
Returns the value of attribute name
2 3 4 |
# File 'lib/sightstone/stat.rb', line 2 def name @name end |
- (Object) value
Returns the value of attribute value
2 3 4 |
# File 'lib/sightstone/stat.rb', line 2 def value @value end |