Class: Xtb::Http::Calendar
Overview
Constant Summary collapse
- IMPACT =
{ 1 => 'low', 2 => 'medium', 3 => 'high' }.freeze
- CalendarRecord =
Data.define(:country, :current, :forecast, :impact, :period, :previous, :time, :title) do def initialize(country:, current:, forecast:, impact:, period:, previous:, time:, title:) super(country:, current:, forecast:, impact: IMPACT[impact.to_i], period:, previous:, time:, title:) end end
Instance Method Summary collapse
Methods inherited from Command
Constructor Details
This class inherits a constructor from Xtb::Http::Command
Instance Method Details
#call ⇒ Object
19 20 21 |
# File 'lib/xtb/http/calendar.rb', line 19 def call super.return_data.map { |record| CalendarRecord.new(**record) } end |