Class: TechnicalAnalysis::VwapValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::VwapValue
- Defined in:
- lib/technical_analysis/indicators/vwap.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.
-
#vwap ⇒ Float
The vwap calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, vwap: nil) ⇒ VwapValue
constructor
A new instance of VwapValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, vwap: nil) ⇒ VwapValue
Returns a new instance of VwapValue.
86 87 88 89 |
# File 'lib/technical_analysis/indicators/vwap.rb', line 86 def initialize(date_time: nil, vwap: nil) @date_time = date_time @vwap = vwap end |
Instance Attribute Details
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
81 82 83 |
# File 'lib/technical_analysis/indicators/vwap.rb', line 81 def date_time @date_time end |
#vwap ⇒ Float
Returns the vwap calculation value.
84 85 86 |
# File 'lib/technical_analysis/indicators/vwap.rb', line 84 def vwap @vwap end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
92 93 94 |
# File 'lib/technical_analysis/indicators/vwap.rb', line 92 def to_hash { date_time: @date_time, vwap: @vwap } end |