Class: Reve::Classes::Asset

Inherits:
Object show all
Defined in:
lib/reve/classes.rb

Overview

An item contained within an AssetContainer (ship, or container) Attributes

  • item_id ( Fixnum ) - A CCP-specific ID for the Asset/AssetContainer

  • type_id ( Fixnum ) - Type ID of the Asset/AssetContainer. (Refer to CCP database dump invtypes)

  • quantity ( Fixnum ) - The number of Asset/AssetContainer at this location_id

  • flag ( Fixnum ) - Inventory flag, refer to wiki.eve-dev.net/API_Inventory_Flags (See also KillLoss’s flag)

See Also: AssetContainer, Reve::API#corporate_assets_list, Reve::API#personal_assets_list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ Asset

:nodoc:



472
473
474
475
476
477
478
479
480
481
# File 'lib/reve/classes.rb', line 472

def initialize(elem) #:nodoc:
  @item_id = elem['itemID'].to_i
  @type_id = elem['typeID'].to_i
  @quantity = elem['quantity'].to_i
  @flag = elem['flag'].to_i
  @singleton = elem['singleton'].to_i
  # This ::Digest::SHA1 is a bit of custom code for Eve Metrics that will
  # probably find its way to all classes since it could prove handy.
  @xml_hash = ::Digest::SHA1.hexdigest elem.to_s.gsub(/\n|\r|\s/,'')
end

Instance Attribute Details

#flagObject (readonly)

Returns the value of attribute flag.



471
472
473
# File 'lib/reve/classes.rb', line 471

def flag
  @flag
end

#item_idObject (readonly)

Returns the value of attribute item_id.



471
472
473
# File 'lib/reve/classes.rb', line 471

def item_id
  @item_id
end

#quantityObject (readonly)

Returns the value of attribute quantity.



471
472
473
# File 'lib/reve/classes.rb', line 471

def quantity
  @quantity
end

#singletonObject (readonly)

Returns the value of attribute singleton.



471
472
473
# File 'lib/reve/classes.rb', line 471

def singleton
  @singleton
end

#type_idObject (readonly)

Returns the value of attribute type_id.



471
472
473
# File 'lib/reve/classes.rb', line 471

def type_id
  @type_id
end

#xml_hashObject (readonly)

Returns the value of attribute xml_hash.



471
472
473
# File 'lib/reve/classes.rb', line 471

def xml_hash
  @xml_hash
end