Class: EodFacade::Options

Inherits:
Base
  • Object
show all
Defined in:
lib/eod_facade/options.rb

Class Method Summary collapse

Methods inherited from Base

make_request

Class Method Details

.call(symbol) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/eod_facade/options.rb', line 8

def call(symbol)
  underlying = EodServices::Contract.underlying_symbol(symbol)
  expiry = EodServices::Contract.contract_expiry(symbol)

  unless expiry
    raise ArgumentError, "Invalid expiration date for option #{symbol}"
  end

  make_request(url_path(underlying), params(expiry))
end