Class: Greeve::Corporation::MarketOrders

Inherits:
BaseItem
  • Object
show all
Defined in:
lib/greeve/corporation/market_orders.rb

Overview

Corporation market orders.

Attributes collapse

Instance Method Summary collapse

Methods inherited from BaseItem

attribute, #cache_expired?, #cached_until, endpoint, #inspect, namespace, #refresh, rowset, #to_s

Methods included from Helpers::AttributeToHash

#to_h

Constructor Details

#initialize(opts = {}) ⇒ MarketOrders

Returns a new instance of MarketOrders

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :order_id (Integer) — default: nil

    ID of an order to retrieve



30
31
32
33
34
35
36
# File 'lib/greeve/corporation/market_orders.rb', line 30

def initialize(opts = {})
  order_id = opts.delete(:order_id)

  opts[:query_params] = { "orderID" => order_id } if order_id

  super(opts)
end

Instance Method Details

#ordersGreeve::Rowset

Parameters:

  • order_id (Integer)
  • char_id (Integer)
  • station_id (Integer)
  • vol_entered (Integer)
  • vol_remaining (Integer)
  • min_volume (Integer)
  • order_state (Integer)
  • type_id (Integer)
  • range (Integer)
  • account_key (Integer)
  • duration (Integer)
  • escrow (BigDecimal)
  • price (BigDecimal)
  • bid
  • issued (Time)

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/greeve/corporation/market_orders.rb', line 11

rowset :orders, xpath: "eveapi/result/rowset[@name='orders']" do
  attribute :order_id,      xpath: "@orderID",      type: :integer
  attribute :char_id,       xpath: "@charID",       type: :integer
  attribute :station_id,    xpath: "@stationID",    type: :integer
  attribute :vol_entered,   xpath: "@volEntered",   type: :integer
  attribute :vol_remaining, xpath: "@volRemaining", type: :integer
  attribute :min_volume,    xpath: "@minVolume",    type: :integer
  attribute :order_state,   xpath: "@orderState",   type: :integer
  attribute :type_id,       xpath: "@typeID",       type: :integer
  attribute :range,         xpath: "@range",        type: :integer
  attribute :account_key,   xpath: "@accountKey",   type: :integer
  attribute :duration,      xpath: "@duration",     type: :integer
  attribute :escrow,        xpath: "@escrow",       type: :numeric
  attribute :price,         xpath: "@price",        type: :numeric
  attribute :bid,           xpath: "@bid",          type: :boolean
  attribute :issued,        xpath: "@issued",       type: :datetime
end