Class: Eodhd
- Inherits:
-
Object
- Object
- Eodhd
- Defined in:
- lib/Eodhd/EodData.rb,
lib/eodhd.rb,
lib/Eodhd/Client.rb,
lib/Eodhd/Exchange.rb,
lib/Eodhd/EodBulkLastDay.rb,
lib/Eodhd/ExchangeSymbol.rb
Overview
Eodhd/ExchangeSymbol.rb Eodhd::ExchangeSymbol
Defined Under Namespace
Classes: Client, EodBulkLastDay, EodData, Exchange, ExchangeSymbol
Instance Method Summary collapse
- #eod_bulk_last_day(exchange: nil, exchange_code: nil, date:) ⇒ Object
- #eod_data(exchange: nil, exchange_code: nil, exchange_symbol: nil, symbol: nil, period: nil, from: nil, to: nil) ⇒ Object
- #exchange_symbols(exchange: nil, exchange_code: nil) ⇒ Object
- #exchanges ⇒ Object
-
#initialize(api_token:) ⇒ Eodhd
constructor
A new instance of Eodhd.
Constructor Details
#initialize(api_token:) ⇒ Eodhd
Returns a new instance of Eodhd.
37 38 39 |
# File 'lib/eodhd.rb', line 37 def initialize(api_token:) @api_token = api_token end |
Instance Method Details
#eod_bulk_last_day(exchange: nil, exchange_code: nil, date:) ⇒ Object
56 57 58 59 |
# File 'lib/eodhd.rb', line 56 def eod_bulk_last_day(exchange: nil, exchange_code: nil, date:) exchange_code ||= exchange.code Eodhd::EodBulkLastDay.all(api_token: @api_token, exchange_code: exchange_code, date: date) end |
#eod_data(exchange: nil, exchange_code: nil, exchange_symbol: nil, symbol: nil, period: nil, from: nil, to: nil) ⇒ Object
50 51 52 53 54 |
# File 'lib/eodhd.rb', line 50 def eod_data(exchange: nil, exchange_code: nil, exchange_symbol: nil, symbol: nil, period: nil, from: nil, to: nil) exchange_code ||= exchange.code symbol ||= exchange_symbol.code Eodhd::EodData.all(api_token: @api_token, exchange_code: exchange_code, symbol: symbol, period: period, from: from, to: to) end |
#exchange_symbols(exchange: nil, exchange_code: nil) ⇒ Object
45 46 47 48 |
# File 'lib/eodhd.rb', line 45 def exchange_symbols(exchange: nil, exchange_code: nil) exchange_code ||= exchange.code Eodhd::ExchangeSymbol.all(api_token: @api_token, exchange_code: exchange_code) end |