Class: TechnicalAnalysis::BbValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::BbValue
- Defined in:
- lib/technical_analysis/indicators/bb.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) ⇒ BbValue
constructor
A new instance of BbValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, lower_band: nil, middle_band: nil, upper_band: nil) ⇒ BbValue
Returns a new instance of BbValue.
108 109 110 111 112 113 |
# File 'lib/technical_analysis/indicators/bb.rb', line 108 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.
97 98 99 |
# File 'lib/technical_analysis/indicators/bb.rb', line 97 def date_time @date_time end |
#lower_band ⇒ Float
Returns the lower_band calculation value.
100 101 102 |
# File 'lib/technical_analysis/indicators/bb.rb', line 100 def lower_band @lower_band end |
#middle_band ⇒ Float
Returns the middle_band calculation value.
103 104 105 |
# File 'lib/technical_analysis/indicators/bb.rb', line 103 def middle_band @middle_band end |
#upper_band ⇒ Float
Returns the upper_band calculation value.
106 107 108 |
# File 'lib/technical_analysis/indicators/bb.rb', line 106 def upper_band @upper_band end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
116 117 118 119 120 121 122 123 |
# File 'lib/technical_analysis/indicators/bb.rb', line 116 def to_hash { date_time: @date_time, lower_band: @lower_band, middle_band: @middle_band, upper_band: @upper_band } end |