Class: Dota2Item
- Defined in:
- lib/steam/community/dota2/dota2_item.rb
Overview
Represents a DotA 2 item
Instance Attribute Summary
Attributes inherited from GameItem
#attributes, #backpack_position, #count, #defindex, #id, #inventory, #item_class, #item_set, #level, #name, #origin, #original_id, #quality, #type
Instance Method Summary collapse
-
#equipped? ⇒ Boolean
Returns whether this item is equipped by this player at all.
-
#initialize(inventory, item_data) ⇒ Dota2Item
constructor
Creates a new instance of a DotA 2 item with the given data.
Methods inherited from GameItem
#craftable?, #preliminary?, #schema_data, #tradeable?
Constructor Details
#initialize(inventory, item_data) ⇒ Dota2Item
Creates a new instance of a DotA 2 item with the given data
18 19 20 21 22 |
# File 'lib/steam/community/dota2/dota2_item.rb', line 18 def initialize(inventory, item_data) super @equipped = !item_data[:equipped].nil? end |
Instance Method Details
#equipped? ⇒ Boolean
Returns whether this item is equipped by this player at all
27 28 29 |
# File 'lib/steam/community/dota2/dota2_item.rb', line 27 def equipped? @equipped end |