Class: TechnicalAnalysis::TrixValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::TrixValue
- Defined in:
- lib/technical_analysis/indicators/trix.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.
-
#trix ⇒ Float
The trix calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, trix: nil) ⇒ TrixValue
constructor
A new instance of TrixValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, trix: nil) ⇒ TrixValue
Returns a new instance of TrixValue.
116 117 118 119 |
# File 'lib/technical_analysis/indicators/trix.rb', line 116 def initialize(date_time: nil, trix: nil) @date_time = date_time @trix = trix end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
111 112 113 |
# File 'lib/technical_analysis/indicators/trix.rb', line 111 def date_time @date_time end |
#trix ⇒ Float
Returns the trix calculation value.
114 115 116 |
# File 'lib/technical_analysis/indicators/trix.rb', line 114 def trix @trix end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
122 123 124 |
# File 'lib/technical_analysis/indicators/trix.rb', line 122 def to_hash { date_time: @date_time, trix: @trix } end |