Class: TechnicalAnalysis::AdiValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::AdiValue
- Defined in:
- lib/technical_analysis/indicators/adi.rb
Overview
The value class to be returned by calculations
Instance Attribute Summary collapse
-
#adi ⇒ Float
The adi calculation value.
-
#date_time ⇒ String
The date_time of the obversation as it was provided.
Instance Method Summary collapse
-
#initialize(date_time: nil, adi: nil) ⇒ AdiValue
constructor
A new instance of AdiValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, adi: nil) ⇒ AdiValue
Returns a new instance of AdiValue.
90 91 92 93 |
# File 'lib/technical_analysis/indicators/adi.rb', line 90 def initialize(date_time: nil, adi: nil) @date_time = date_time @adi = adi end |
Instance Attribute Details
#adi ⇒ Float
Returns the adi calculation value.
88 89 90 |
# File 'lib/technical_analysis/indicators/adi.rb', line 88 def adi @adi end |
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
85 86 87 |
# File 'lib/technical_analysis/indicators/adi.rb', line 85 def date_time @date_time end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
96 97 98 |
# File 'lib/technical_analysis/indicators/adi.rb', line 96 def to_hash { date_time: @date_time, adi: @adi } end |