Class: Wowr::Classes::ItemSource
- Inherits:
-
Object
- Object
- Wowr::Classes::ItemSource
- Defined in:
- lib/wowr/item.rb
Instance Attribute Summary collapse
-
#area_id ⇒ Object
readonly
Returns the value of attribute area_id.
-
#area_name ⇒ Object
readonly
Returns the value of attribute area_name.
-
#creature_id ⇒ Object
readonly
Returns the value of attribute creature_id.
-
#creature_name ⇒ Object
readonly
Returns the value of attribute creature_name.
-
#difficulty ⇒ Object
readonly
Returns the value of attribute difficulty.
-
#drop_rate ⇒ Object
readonly
Returns the value of attribute drop_rate.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(elem) ⇒ ItemSource
constructor
A new instance of ItemSource.
Constructor Details
#initialize(elem) ⇒ ItemSource
Returns a new instance of ItemSource.
381 382 383 384 385 386 387 388 389 390 |
# File 'lib/wowr/item.rb', line 381 def initialize(elem) @value = elem[:value] @area_id = elem[:areaId].to_i if elem[:areaId] @area_name = elem[:areaName] if elem[:areaName] @creature_id = elem[:creatureId].to_i if elem[:creatureId] @creature_name = elem[:creatureName] if elem[:creatureName] @difficulty = elem[:difficulty] if elem[:difficulty] @drop_rate = elem[:dropRate].to_i if elem[:dropRate] @required_level = elem[:reqLvl].to_i if elem[:reqLvl] end |
Instance Attribute Details
#area_id ⇒ Object (readonly)
Returns the value of attribute area_id.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def area_id @area_id end |
#area_name ⇒ Object (readonly)
Returns the value of attribute area_name.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def area_name @area_name end |
#creature_id ⇒ Object (readonly)
Returns the value of attribute creature_id.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def creature_id @creature_id end |
#creature_name ⇒ Object (readonly)
Returns the value of attribute creature_name.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def creature_name @creature_name end |
#difficulty ⇒ Object (readonly)
Returns the value of attribute difficulty.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def difficulty @difficulty end |
#drop_rate ⇒ Object (readonly)
Returns the value of attribute drop_rate.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def drop_rate @drop_rate end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
376 377 378 |
# File 'lib/wowr/item.rb', line 376 def value @value end |