Class: TechnicalAnalysis::AtrValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::AtrValue
- Defined in:
- lib/technical_analysis/indicators/atr.rb
Overview
The value class to be returned by calculations
Instance Attribute Summary collapse
-
#atr ⇒ Float
The atr calculation value.
-
#date_time ⇒ String
The date_time of the obversation as it was provided.
Instance Method Summary collapse
-
#initialize(date_time: nil, atr: nil) ⇒ AtrValue
constructor
A new instance of AtrValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, atr: nil) ⇒ AtrValue
Returns a new instance of AtrValue.
98 99 100 101 |
# File 'lib/technical_analysis/indicators/atr.rb', line 98 def initialize(date_time: nil, atr: nil) @date_time = date_time @atr = atr end |
Instance Attribute Details
#atr ⇒ Float
Returns the atr calculation value.
96 97 98 |
# File 'lib/technical_analysis/indicators/atr.rb', line 96 def atr @atr end |
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
93 94 95 |
# File 'lib/technical_analysis/indicators/atr.rb', line 93 def date_time @date_time end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
104 105 106 |
# File 'lib/technical_analysis/indicators/atr.rb', line 104 def to_hash { date_time: @date_time, atr: @atr } end |