Class: TechnicalAnalysis::VptValue

Inherits:
Object
  • Object
show all
Defined in:
lib/technical_analysis/indicators/vpt.rb

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, vpt: nil) ⇒ VptValue

Returns a new instance of VptValue.



84
85
86
87
# File 'lib/technical_analysis/indicators/vpt.rb', line 84

def initialize(date_time: nil, vpt: nil)
  @date_time = date_time
  @vpt = vpt
end

Instance Attribute Details

#date_timeString

Returns the date_time of the obversation as it was provided.

Returns:

  • (String)

    the date_time of the obversation as it was provided



79
80
81
# File 'lib/technical_analysis/indicators/vpt.rb', line 79

def date_time
  @date_time
end

#vptFloat

Returns the vpt calculation value.

Returns:

  • (Float)

    the vpt calculation value



82
83
84
# File 'lib/technical_analysis/indicators/vpt.rb', line 82

def vpt
  @vpt
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



90
91
92
# File 'lib/technical_analysis/indicators/vpt.rb', line 90

def to_hash
  { date_time: @date_time, vpt: @vpt }
end