Class: Dtn::Lookups::Historical::DailyTimeframe

Inherits:
Interval show all
Defined in:
lib/dtn/lookups/historical/daily_timeframe.rb

Overview

Daily timeframe requests

Constant Summary collapse

TEMPLATE =
"HDT,%<symbol>s,%<begin_date>s,%<end_date>s,%<max_datapoints>d,%<data_direction>d,%<id>d"

Constants inherited from Base

Base::DEFAULT_BEGIN_FILTER_TIME, Base::DEFAULT_DATAPOINTS_PER_SEND, Base::DEFAULT_DATA_DIRECTION, Base::DEFAULT_END_FILTER_TIME, Base::DEFAULT_MAX_DATAPOINTS

Constants included from Concerns::Validation

Concerns::Validation::DATE_FORMAT, Concerns::Validation::DATE_TIME_FORMAT, Concerns::Validation::DEFAULT_INTERVAL_TYPE, Concerns::Validation::MAX_INT16

Constants inherited from Request

Request::END_OF_MESSAGE_CHARACTERS, Request::NO_DATA_CHARACTERS, Request::PORT, Request::SYNTAX_ERROR_CHARACTERS

Instance Attribute Summary

Attributes inherited from Request

#combined_options

Instance Method Summary collapse

Methods inherited from Request

call

Methods included from Concerns::Id

#id

Instance Method Details

#call(symbol:, begin_date:, end_date:, **options) ⇒ Object

HDT - Retrieves [Days] days of interval data for the specified [Symbol].

Example message

HDT,[Symbol],[BeginDate],[EndDate],[MaxDatapoints],[DataDirection],[RequestID],\
[DatapointsPerSend]<CR><LF>


17
18
19
20
21
22
23
24
25
26
# File 'lib/dtn/lookups/historical/daily_timeframe.rb', line 17

def call(symbol:, begin_date:, end_date:, **options)
  self.combined_options = defaults(**options).merge(
    {
      symbol: validate_symbol(symbol),
      begin_date: validate_date(begin_date),
      end_date: validate_date(end_date)
    }
  )
  super
end

#expected_messages_classObject



28
29
30
# File 'lib/dtn/lookups/historical/daily_timeframe.rb', line 28

def expected_messages_class
  Messages::Historical::DailyWeeklyMonthly
end