Class: Greeve::Character::Contracts

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

Overview

Available contracts from a character.

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(character_id, opts = {}) ⇒ Contracts

Returns a new instance of Contracts.

Parameters:

  • character_id (Integer)

    EVE character ID

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

    a customizable set of options

Options Hash (opts):

  • :contract_id (Integer) — default: nil

    ID of a specific contract



39
40
41
42
43
44
45
46
# File 'lib/greeve/character/contracts.rb', line 39

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

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

  super(opts)
end