Class: TechnicalAnalysis::CmfValue

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

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, cmf: nil) ⇒ CmfValue

Returns a new instance of CmfValue.



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

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

Instance Attribute Details

#cmfFloat

Returns the cmf calculation value.

Returns:

  • (Float)

    the cmf calculation value



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

def cmf
  @cmf
end

#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



89
90
91
# File 'lib/technical_analysis/indicators/cmf.rb', line 89

def date_time
  @date_time
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



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

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