Class: Quant::IndicatorsRegistry::ClassMethods::RegistryEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/quant/indicators_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, indicator_class:) ⇒ RegistryEntry

Returns a new instance of RegistryEntry.



21
22
23
24
# File 'lib/quant/indicators_registry.rb', line 21

def initialize(name:, indicator_class:)
  @name = name
  @indicator_class = indicator_class
end

Instance Attribute Details

#indicator_classObject (readonly)

Returns the value of attribute indicator_class.



19
20
21
# File 'lib/quant/indicators_registry.rb', line 19

def indicator_class
  @indicator_class
end

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/quant/indicators_registry.rb', line 19

def name
  @name
end

Instance Method Details

#dominant_cycle?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/quant/indicators_registry.rb', line 38

def dominant_cycle?
  indicator_class < Indicators::DominantCycles::DominantCycle
end

#keyObject



26
27
28
# File 'lib/quant/indicators_registry.rb', line 26

def key
  "#{indicator_class.name}::#{name}"
end

#pivot?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/quant/indicators_registry.rb', line 34

def pivot?
  indicator_class < Indicators::Pivots::Pivot
end

#standard?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/quant/indicators_registry.rb', line 30

def standard?
  !pivot? && !dominant_cycle?
end