Class: TechnicalAnalysis::KcValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::KcValue
- Defined in:
- lib/technical_analysis/indicators/kc.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_band ⇒ Float
The lower_band calculation value.
-
#middle_band ⇒ Float
The middle_band calculation value.
-
#upper_band ⇒ Float
The upper_band calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, lower_band: nil, middle_band: nil, upper_band: nil) ⇒ KcValue
constructor
A new instance of KcValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, lower_band: nil, middle_band: nil, upper_band: nil) ⇒ KcValue
Returns a new instance of KcValue.
106 107 108 109 110 111 |
# File 'lib/technical_analysis/indicators/kc.rb', line 106 def initialize(date_time: nil, lower_band: nil, middle_band: nil, upper_band: nil) @date_time = date_time @lower_band = lower_band @middle_band = middle_band @upper_band = upper_band end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
95 96 97 |
# File 'lib/technical_analysis/indicators/kc.rb', line 95 def date_time @date_time end |
#lower_band ⇒ Float
Returns the lower_band calculation value.
98 99 100 |
# File 'lib/technical_analysis/indicators/kc.rb', line 98 def lower_band @lower_band end |
#middle_band ⇒ Float
Returns the middle_band calculation value.
101 102 103 |
# File 'lib/technical_analysis/indicators/kc.rb', line 101 def middle_band @middle_band end |
#upper_band ⇒ Float
Returns the upper_band calculation value.
104 105 106 |
# File 'lib/technical_analysis/indicators/kc.rb', line 104 def upper_band @upper_band end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
114 115 116 117 118 119 120 121 |
# File 'lib/technical_analysis/indicators/kc.rb', line 114 def to_hash { date_time: @date_time, lower_band: @lower_band, middle_band: @middle_band, upper_band: @upper_band } end |