Class: TradingviewScreener::Predicates::Op

Inherits:
Object
  • Object
show all
Defined in:
lib/tradingview_screener/predicate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation, value) ⇒ Op

Returns a new instance of Op.



99
100
101
102
103
104
# File 'lib/tradingview_screener/predicate.rb', line 99

def initialize(operation, value)
  @operation = operation
  @value = value.is_a?(Field) || value.is_a?(Symbol) ? value.to_s.sub(/\A:/, "") : value
  @value = value.name if value.is_a?(Field)
  @value = value.to_s if value.is_a?(Symbol)
end

Instance Attribute Details

#operationObject (readonly)

Returns the value of attribute operation.



97
98
99
# File 'lib/tradingview_screener/predicate.rb', line 97

def operation
  @operation
end

#valueObject (readonly)

Returns the value of attribute value.



97
98
99
# File 'lib/tradingview_screener/predicate.rb', line 97

def value
  @value
end