Class: TechnicalAnalysis::ObvMeanValue

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

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, obv_mean: nil) ⇒ ObvMeanValue

Returns a new instance of ObvMeanValue.



99
100
101
102
# File 'lib/technical_analysis/indicators/obv_mean.rb', line 99

def initialize(date_time: nil, obv_mean: nil)
  @date_time = date_time
  @obv_mean = obv_mean
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



94
95
96
# File 'lib/technical_analysis/indicators/obv_mean.rb', line 94

def date_time
  @date_time
end

#obv_meanFloat

Returns the obv_mean calculation value.

Returns:

  • (Float)

    the obv_mean calculation value



97
98
99
# File 'lib/technical_analysis/indicators/obv_mean.rb', line 97

def obv_mean
  @obv_mean
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



105
106
107
# File 'lib/technical_analysis/indicators/obv_mean.rb', line 105

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