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