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