Class: RubyTechnicalAnalysis::Indicator

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_technical_analysis/indicator.rb

Overview

Base class for indicators

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(series: []) ⇒ Indicator

Returns a new instance of Indicator.

Parameters:

  • series (Array) (defaults to: [])

    An array of prices



11
12
13
# File 'lib/ruby_technical_analysis/indicator.rb', line 11

def initialize(series: [])
  @series = series
end

Instance Attribute Details

#seriesObject (readonly)

Returns the value of attribute series.



4
5
6
# File 'lib/ruby_technical_analysis/indicator.rb', line 4

def series
  @series
end

Class Method Details

.call(**kwargs) ⇒ Object

standard:disable Style/ArgumentsForwarding



6
7
8
# File 'lib/ruby_technical_analysis/indicator.rb', line 6

def self.call(**kwargs) # standard:disable Style/ArgumentsForwarding
  new(**kwargs).call # standard:disable Style/ArgumentsForwarding
end