Class: Dtn::Messages::Bar::Base

Inherits:
MessageWithSimpleParser show all
Defined in:
lib/dtn/messages/bar/base.rb

Overview

Streaming Bars data.

Direct Known Subclasses

CurrentBar, HistoricalBar, UpdateBar

Class Method Summary collapse

Methods inherited from MessageWithSimpleParser

parse, #termination?

Methods inherited from Dtn::Message

#callback_name, callback_name, parse

Class Method Details

.fieldsObject

rubocop:disable Metrics/MethodLength



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dtn/messages/bar/base.rb', line 10

def fields
  @fields ||= {
    request_id: :to_i,
    _skip: nil,
    symbol: :to_s,
    timestamp: :to_datetime,
    open: :to_f,
    high: :to_f,
    low: :to_f,
    close: :to_f,
    total_volume: :to_i,
    volume: :to_i,
    number_of_trades: :to_i
  }
end