Class: Xtb::Http::News

Inherits:
Command show all
Defined in:
lib/xtb/http/news.rb

Overview

Constant Summary collapse

NewsTopicRecord =
Data.define(:body, :bodylen, :key, :time, :time_string, :title)

Instance Method Summary collapse

Methods inherited from Command

call

Constructor Details

#initialize(end_time, start_time) ⇒ News

Returns a new instance of News.

Parameters:

  • end_time (Time)
  • start_time (Time)


11
12
13
14
15
16
# File 'lib/xtb/http/news.rb', line 11

def initialize(end_time, start_time)
  @end_time = end_time
  @start_time = start_time

  super()
end

Instance Method Details

#callObject



18
19
20
# File 'lib/xtb/http/news.rb', line 18

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