Class: TechnicalAnalysis::KstValue

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

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, kst: nil) ⇒ KstValue

Returns a new instance of KstValue.



121
122
123
124
# File 'lib/technical_analysis/indicators/kst.rb', line 121

def initialize(date_time: nil, kst: nil)
  @date_time = date_time
  @kst = kst
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



116
117
118
# File 'lib/technical_analysis/indicators/kst.rb', line 116

def date_time
  @date_time
end

#kstFloat

Returns the kst calculation value.

Returns:

  • (Float)

    the kst calculation value



119
120
121
# File 'lib/technical_analysis/indicators/kst.rb', line 119

def kst
  @kst
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



127
128
129
# File 'lib/technical_analysis/indicators/kst.rb', line 127

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