Class: TechnicalAnalysis::MfiValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::MfiValue
- Defined in:
- lib/technical_analysis/indicators/mfi.rb
Overview
The value class to be returned by calculations
Instance Attribute Summary collapse
-
#date_time ⇒ String
The date_time of the obversation as it was provided.
-
#mfi ⇒ Float
The mfi calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, mfi: nil) ⇒ MfiValue
constructor
A new instance of MfiValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, mfi: nil) ⇒ MfiValue
Returns a new instance of MfiValue.
108 109 110 111 |
# File 'lib/technical_analysis/indicators/mfi.rb', line 108 def initialize(date_time: nil, mfi: nil) @date_time = date_time @mfi = mfi end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
103 104 105 |
# File 'lib/technical_analysis/indicators/mfi.rb', line 103 def date_time @date_time end |
#mfi ⇒ Float
Returns the mfi calculation value.
106 107 108 |
# File 'lib/technical_analysis/indicators/mfi.rb', line 106 def mfi @mfi end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
114 115 116 |
# File 'lib/technical_analysis/indicators/mfi.rb', line 114 def to_hash { date_time: @date_time, mfi: @mfi } end |