Class: TechnicalAnalysis::WrValue

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

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, wr: nil) ⇒ WrValue

Returns a new instance of WrValue.



92
93
94
95
# File 'lib/technical_analysis/indicators/wr.rb', line 92

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



87
88
89
# File 'lib/technical_analysis/indicators/wr.rb', line 87

def date_time
  @date_time
end

#wrFloat

Returns the wr calculation value.

Returns:

  • (Float)

    the wr calculation value



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

def wr
  @wr
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



98
99
100
# File 'lib/technical_analysis/indicators/wr.rb', line 98

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