Class: Reve::Classes::MarketOrder

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

Overview

Used for the Reve::API#personal_market_orders and Reve::API#corporate_market_orders Each of those derrive from this parent class. Attributes

  • id ( Fixnum ) - ID of the MarketOrder. This is a CCP internal ID and is not guaranteed to always be unique! You may want to generate your own globally unique ID for this.

  • character_id ( Fixnum ) - ID of the Character who set this MarketOrder up

  • station_id ( Fixnum ) - ID of the Station where the MarketOrder is

  • volume_entered ( Fixnum ) - How many of type_id was initially entered in the MarketOrder

  • volume_remaining ( Fixnum ) - How many of type_id is left in the MarketOrder

  • minimum_volume ( Fixnum ) - How much of type_id can be transacted (as a minimum) at once

  • order_state ( String ) - String representation of the MarketOrder's current state. Options are: Active, Closed, Expired, Cancelled, Pending, Character Deleted

  • type_id ( Fixnum ) - Type ID of item for which the MarketOrder was created. (Refer to CCP database dump invtypes)

  • range ( Fixnum ) - Range of the MarketOrder. For sell orders it is always 32767 (Entire Region), for sell orders the values are -1 (Station only), 0 (Solar system), 1..40 (Number of jumps away from the Station), 32767 (Region wide)

  • account_key ( Fixnum ) - For a CorporateMarketOrder the account key (see WalletDivision and CorporationSheet) that was used as the source/destination.

  • duration ( Fixnum ) - Duration of the MarketOrder in days from when it was created_at

  • escrow ( Float ) - How much ISK is held in escrow for the MarketOrder

  • price ( Float ) - Unit price of the item in the MarketOrder

  • bid ( Boolean ) - True if this MarketOrder is a sell order, false otherwise

  • created_at ( Time ) - When the MarketOrder was created

See Also: CorporationSheet, WalletDivision, CorporateDivision, Reve::API#personal_market_orders, Reve::API#corporate_market_orders

Direct Known Subclasses

CorporateMarketOrder, PersonalMarketOrder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ MarketOrder

:nodoc:



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
# File 'lib/reve/classes.rb', line 1046

def initialize(elem) #:nodoc:
  @id = elem['orderID'].to_i
  @character_id = elem['charID'].to_i
  @station_id = elem['stationID'].to_i
  @volume_entered = elem['volEntered'].to_i
  @volume_remaining = elem['volRemaining'].to_i
  @minimum_volume = elem['minVolume'].to_i
  @order_state = case elem['orderState'].to_i
                 when 0
                   'Active'
                 when 1
                   'Closed'
                 when 2
                   'Expired'
                 when 3
                   'Cancelled'
                 when 4
                   'Pending'
                 when 5
                   'Character Deleted'
                 end
  @type_id = elem['typeID'].to_i
  @range = elem['range'].to_i
  @account_key = elem['accountKey'].to_i
  @escrow = elem['escrow'].to_f
  @price = elem['price'].to_f
  @bid = elem['bid'] == '1'
  @duration = elem['duration'].to_i
  @created_at = elem['issued'].to_time
end

Instance Attribute Details

#account_keyObject (readonly)

Returns the value of attribute account_key



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def 
  @account_key
end

#bidObject (readonly)

Returns the value of attribute bid



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def bid
  @bid
end

#character_idObject (readonly)

Returns the value of attribute character_id



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def character_id
  @character_id
end

#created_atObject (readonly)

Returns the value of attribute created_at



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def created_at
  @created_at
end

#durationObject (readonly)

Returns the value of attribute duration



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def duration
  @duration
end

#escrowObject (readonly)

Returns the value of attribute escrow



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def escrow
  @escrow
end

#idObject (readonly)

Returns the value of attribute id



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def id
  @id
end

#minimum_volumeObject (readonly)

Returns the value of attribute minimum_volume



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def minimum_volume
  @minimum_volume
end

#order_stateObject (readonly)

Returns the value of attribute order_state



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def order_state
  @order_state
end

#priceObject (readonly)

Returns the value of attribute price



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def price
  @price
end

#rangeObject (readonly)

Returns the value of attribute range



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def range
  @range
end

#station_idObject (readonly)

Returns the value of attribute station_id



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def station_id
  @station_id
end

#type_idObject (readonly)

Returns the value of attribute type_id



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def type_id
  @type_id
end

#volume_enteredObject (readonly)

Returns the value of attribute volume_entered



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def volume_entered
  @volume_entered
end

#volume_remainingObject (readonly)

Returns the value of attribute volume_remaining



1044
1045
1046
# File 'lib/reve/classes.rb', line 1044

def volume_remaining
  @volume_remaining
end