Class: TechnicalAnalysis::DlrValue

Inherits:
Object
  • Object
show all
Defined in:
lib/technical_analysis/indicators/dlr.rb

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, dlr: nil) ⇒ DlrValue

Returns a new instance of DlrValue.



86
87
88
89
# File 'lib/technical_analysis/indicators/dlr.rb', line 86

def initialize(date_time: nil, dlr: nil)
  @date_time = date_time
  @dlr = dlr
end

Instance Attribute Details

#date_timeString

Returns the date_time of the obversation as it was provided.

Returns:

  • (String)

    the date_time of the obversation as it was provided



81
82
83
# File 'lib/technical_analysis/indicators/dlr.rb', line 81

def date_time
  @date_time
end

#dlrFloat

Returns the dlr calculation value.

Returns:

  • (Float)

    the dlr calculation value



84
85
86
# File 'lib/technical_analysis/indicators/dlr.rb', line 84

def dlr
  @dlr
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



92
93
94
# File 'lib/technical_analysis/indicators/dlr.rb', line 92

def to_hash
  { date_time: @date_time, dlr: @dlr }
end