Class: TechnicalAnalysis::MiValue

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

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, mi: nil) ⇒ MiValue

Returns a new instance of MiValue.



110
111
112
113
# File 'lib/technical_analysis/indicators/mi.rb', line 110

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



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

def date_time
  @date_time
end

#miFloat

Returns the mi calculation value.

Returns:

  • (Float)

    the mi calculation value



108
109
110
# File 'lib/technical_analysis/indicators/mi.rb', line 108

def mi
  @mi
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



116
117
118
# File 'lib/technical_analysis/indicators/mi.rb', line 116

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