Class: Eodhd

Inherits:
Object
  • Object
show all
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

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

#exchangesObject



41
42
43
# File 'lib/eodhd.rb', line 41

def exchanges
  Eodhd::Exchange.all(api_token: @api_token)
end