Class: Reve::Classes::AssetContainer

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

Overview

A container or singleton (unpackaged thing). Attributes

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

  • location_id ( Fixnum ) - The ID of the Station (or POS?) that the Asset/AssetContainer is at.

  • 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)

  • singleton ( Boolean ) - True if the Asset/AssetContainer is not packaged up.

  • assets ( [Asset] ) - A list of Asset objects that are contained in this AssetContainer.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ AssetContainer

Returns a new instance of AssetContainer.



449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/reve/classes.rb', line 449

def initialize(elem)
  @item_id = elem['itemID'].to_i
  @location_id = elem['locationID'].to_i
  @type_id = elem['typeID'].to_i
  @quantity = elem['quantity'].to_i
  @flag = elem['flag'].to_i
  @singleton = elem['singleton'] == "1"
  @assets = []
  # 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

#assetsObject

Returns the value of attribute assets.



448
449
450
# File 'lib/reve/classes.rb', line 448

def assets
  @assets
end

#flagObject (readonly)

Returns the value of attribute flag.



447
448
449
# File 'lib/reve/classes.rb', line 447

def flag
  @flag
end

#item_idObject (readonly)

Returns the value of attribute item_id.



447
448
449
# File 'lib/reve/classes.rb', line 447

def item_id
  @item_id
end

#location_idObject (readonly)

Returns the value of attribute location_id.



447
448
449
# File 'lib/reve/classes.rb', line 447

def location_id
  @location_id
end

#quantityObject (readonly)

Returns the value of attribute quantity.



447
448
449
# File 'lib/reve/classes.rb', line 447

def quantity
  @quantity
end

#singletonObject (readonly)

Returns the value of attribute singleton.



447
448
449
# File 'lib/reve/classes.rb', line 447

def singleton
  @singleton
end

#type_idObject (readonly)

Returns the value of attribute type_id.



447
448
449
# File 'lib/reve/classes.rb', line 447

def type_id
  @type_id
end

#xml_hashObject (readonly)

Returns the value of attribute xml_hash.



447
448
449
# File 'lib/reve/classes.rb', line 447

def xml_hash
  @xml_hash
end