Class: TechnicalAnalysis::TsiValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::TsiValue
- Defined in:
- lib/technical_analysis/indicators/tsi.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.
-
#tsi ⇒ Float
The tsi calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, tsi: nil) ⇒ TsiValue
constructor
A new instance of TsiValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, tsi: nil) ⇒ TsiValue
Returns a new instance of TsiValue.
128 129 130 131 |
# File 'lib/technical_analysis/indicators/tsi.rb', line 128 def initialize(date_time: nil, tsi: nil) @date_time = date_time @tsi = tsi end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
123 124 125 |
# File 'lib/technical_analysis/indicators/tsi.rb', line 123 def date_time @date_time end |
#tsi ⇒ Float
Returns the tsi calculation value.
126 127 128 |
# File 'lib/technical_analysis/indicators/tsi.rb', line 126 def tsi @tsi end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
134 135 136 |
# File 'lib/technical_analysis/indicators/tsi.rb', line 134 def to_hash { date_time: @date_time, tsi: @tsi } end |