Class: SteamCondenser::Community::Dota2Item

Inherits:
GameItem
  • Object
show all
Defined in:
lib/steam-condenser/community/dota2/dota2_item.rb

Overview

Represents a DotA 2 item

Author:

  • Sebastian Staudt

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

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

Parameters:

  • inventory (Dota2Inventory)

    The inventory this item is contained in

  • item_data (Hash<Symbol, Object>)

    The data specifying this item

Raises:


20
21
22
23
24
# File 'lib/steam-condenser/community/dota2/dota2_item.rb', line 20

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

Returns:

  • (Boolean)

    Whether this item is equipped by this player at all


29
30
31
# File 'lib/steam-condenser/community/dota2/dota2_item.rb', line 29

def equipped?
  @equipped
end