Class: TechnicalAnalysis::ViValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::ViValue
- Defined in:
- lib/technical_analysis/indicators/vi.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.
-
#negative_vi ⇒ Float
The negative Vortex Indicator value.
-
#positive_vi ⇒ Float
The positive Vortex Indicator value.
Instance Method Summary collapse
-
#initialize(date_time: nil, positive_vi: nil, negative_vi: nil) ⇒ ViValue
constructor
A new instance of ViValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, positive_vi: nil, negative_vi: nil) ⇒ ViValue
Returns a new instance of ViValue.
105 106 107 108 109 |
# File 'lib/technical_analysis/indicators/vi.rb', line 105 def initialize(date_time: nil, positive_vi: nil, negative_vi: nil) @date_time = date_time @positive_vi = positive_vi @negative_vi = negative_vi end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
97 98 99 |
# File 'lib/technical_analysis/indicators/vi.rb', line 97 def date_time @date_time end |
#negative_vi ⇒ Float
Returns the negative Vortex Indicator value.
103 104 105 |
# File 'lib/technical_analysis/indicators/vi.rb', line 103 def negative_vi @negative_vi end |
#positive_vi ⇒ Float
Returns the positive Vortex Indicator value.
100 101 102 |
# File 'lib/technical_analysis/indicators/vi.rb', line 100 def positive_vi @positive_vi end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
112 113 114 |
# File 'lib/technical_analysis/indicators/vi.rb', line 112 def to_hash { date_time: @date_time, positive_vi: @positive_vi, negative_vi: @negative_vi } end |