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:



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# File 'lib/reve/classes.rb', line 1001

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



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def 
  @account_key
end

#bidObject (readonly)

Returns the value of attribute bid



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def bid
  @bid
end

#character_idObject (readonly)

Returns the value of attribute character_id



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def character_id
  @character_id
end

#created_atObject (readonly)

Returns the value of attribute created_at



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def created_at
  @created_at
end

#durationObject (readonly)

Returns the value of attribute duration



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def duration
  @duration
end

#escrowObject (readonly)

Returns the value of attribute escrow



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def escrow
  @escrow
end

#idObject (readonly)

Returns the value of attribute id



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def id
  @id
end

#minimum_volumeObject (readonly)

Returns the value of attribute minimum_volume



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def minimum_volume
  @minimum_volume
end

#order_stateObject (readonly)

Returns the value of attribute order_state



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def order_state
  @order_state
end

#priceObject (readonly)

Returns the value of attribute price



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def price
  @price
end

#rangeObject (readonly)

Returns the value of attribute range



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def range
  @range
end

#station_idObject (readonly)

Returns the value of attribute station_id



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def station_id
  @station_id
end

#type_idObject (readonly)

Returns the value of attribute type_id



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def type_id
  @type_id
end

#volume_enteredObject (readonly)

Returns the value of attribute volume_entered



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def volume_entered
  @volume_entered
end

#volume_remainingObject (readonly)

Returns the value of attribute volume_remaining



999
1000
1001
# File 'lib/reve/classes.rb', line 999

def volume_remaining
  @volume_remaining
end