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