Class: TechnicalAnalysis::DpoValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::DpoValue
- Defined in:
- lib/technical_analysis/indicators/dpo.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.
-
#dpo ⇒ Float
The dpo calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, dpo: nil) ⇒ DpoValue
constructor
A new instance of DpoValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, dpo: nil) ⇒ DpoValue
Returns a new instance of DpoValue.
95 96 97 98 |
# File 'lib/technical_analysis/indicators/dpo.rb', line 95 def initialize(date_time: nil, dpo: nil) @date_time = date_time @dpo = dpo end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
90 91 92 |
# File 'lib/technical_analysis/indicators/dpo.rb', line 90 def date_time @date_time end |
#dpo ⇒ Float
Returns the dpo calculation value.
93 94 95 |
# File 'lib/technical_analysis/indicators/dpo.rb', line 93 def dpo @dpo end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
101 102 103 |
# File 'lib/technical_analysis/indicators/dpo.rb', line 101 def to_hash { date_time: @date_time, dpo: @dpo } end |