Class: TechnicalAnalysis::SrValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::SrValue
- Defined in:
- lib/technical_analysis/indicators/sr.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.
-
#sr ⇒ Float
The sr calculation value.
-
#sr_signal ⇒ Float
The sr_signal calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, sr: nil, sr_signal: nil) ⇒ SrValue
constructor
A new instance of SrValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, sr: nil, sr_signal: nil) ⇒ SrValue
Returns a new instance of SrValue.
110 111 112 113 114 |
# File 'lib/technical_analysis/indicators/sr.rb', line 110 def initialize(date_time: nil, sr: nil, sr_signal: nil) @date_time = date_time @sr = sr @sr_signal = sr_signal end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
102 103 104 |
# File 'lib/technical_analysis/indicators/sr.rb', line 102 def date_time @date_time end |
#sr ⇒ Float
Returns the sr calculation value.
105 106 107 |
# File 'lib/technical_analysis/indicators/sr.rb', line 105 def sr @sr end |
#sr_signal ⇒ Float
Returns the sr_signal calculation value.
108 109 110 |
# File 'lib/technical_analysis/indicators/sr.rb', line 108 def sr_signal @sr_signal end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
117 118 119 |
# File 'lib/technical_analysis/indicators/sr.rb', line 117 def to_hash { date_time: @date_time, sr: @sr, sr_signal: @sr_signal } end |