Class: Xtb::Http::TradingHours

Inherits:
Command
  • Object
show all
Defined in:
lib/xtb/http/trading_hours.rb

Overview

Constant Summary collapse

TimesRecord =

Represents both quotes and trading times records.

Data.define(:day, :from_t, :to_t)
TradingHoursRecord =
Data.define(:quotes, :symbol, :trading) do
  def initialize(symbol:, quotes: TimesRecord.new, trading: TimesRecord.new)
    super(quotes:, symbol:, trading:)
  end
end

Instance Method Summary collapse

Methods inherited from Command

call

Constructor Details

#initialize(symbols) ⇒ TradingHours

Returns a new instance of TradingHours.

Parameters:

  • symbols (Array<String|Symbol>)


17
18
19
20
21
# File 'lib/xtb/http/trading_hours.rb', line 17

def initialize(symbols)
  @symbols = symbols

  super()
end

Instance Method Details

#callObject



23
24
25
# File 'lib/xtb/http/trading_hours.rb', line 23

def call
  super.return_data.map { |record| TradingHoursRecord.new(**record) }
end