Class: Greeve::Corporation::Contracts

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

Overview

Availabile contracts for a corporation.

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 = {}) ⇒ Contracts

Returns a new instance of Contracts

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :contract_id (Integer) — default: nil

    ID of a specific contract



37
38
39
40
41
42
43
# File 'lib/greeve/corporation/contracts.rb', line 37

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

  opts[:query_params] = { "contractID" => contract_id } if contract_id

  super(opts)
end

Instance Method Details

#contract_listGreeve::Rowset

Parameters:

  • contract_id (Integer)
  • issuer_id (Integer)
  • issuer_corp_id (Integer)
  • assignee_id (Integer)
  • acceptor_id (Integer)
  • start_station_id (Integer)
  • end_station_id (Integer)
  • type (String)
  • status (String)
  • title (String)
  • for_corp
  • availability (String)
  • date_issued (Time)
  • date_expired (Time)
  • date_accepted (Time)
  • date_completed (Time)
  • num_days (Integer)
  • price (BigDecimal)
  • reward (BigDecimal)
  • colalteral (BigDecimal)
  • buyout (BigDecimal)
  • volume (BigDecimal)

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/greeve/corporation/contracts.rb', line 11

rowset :contract_list, xpath: "eveapi/result/rowset[@name='contractList']" do
  attribute :contract_id,      xpath: "@contractID",     type: :integer
  attribute :issuer_id,        xpath: "@issuerID",       type: :integer
  attribute :issuer_corp_id,   xpath: "@issuerCorpID",   type: :integer
  attribute :assignee_id,      xpath: "@assigneeID",     type: :integer
  attribute :acceptor_id,      xpath: "@acceptorID",     type: :integer
  attribute :start_station_id, xpath: "@startStationID", type: :integer
  attribute :end_station_id,   xpath: "@endStationID",   type: :integer
  attribute :type,             xpath: "@type",           type: :string
  attribute :status,           xpath: "@status",         type: :string
  attribute :title,            xpath: "@title",          type: :string
  attribute :for_corp,         xpath: "@forCorp",        type: :boolean
  attribute :availability,     xpath: "@availability",   type: :string
  attribute :date_issued,      xpath: "@dateIssued",     type: :datetime
  attribute :date_expired,     xpath: "@dateExpired",    type: :datetime
  attribute :date_accepted,    xpath: "@dateAccepted",   type: :datetime
  attribute :date_completed,   xpath: "@dateCompleted",  type: :datetime
  attribute :num_days,         xpath: "@numDays",        type: :integer
  attribute :price,            xpath: "@price",          type: :numeric
  attribute :reward,           xpath: "@reward",         type: :numeric
  attribute :colalteral,       xpath: "@collateral",     type: :numeric
  attribute :buyout,           xpath: "@buyout",         type: :numeric
  attribute :volume,           xpath: "@volume",         type: :numeric
end