Class: TradingviewScreener::Field

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Field

Returns a new instance of Field.



41
42
43
# File 'lib/tradingview_screener/predicate.rb', line 41

def initialize(name)
  @name = name.to_s
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



39
40
41
# File 'lib/tradingview_screener/predicate.rb', line 39

def name
  @name
end

Instance Method Details

#!=(other) ⇒ Object



70
# File 'lib/tradingview_screener/predicate.rb', line 70

def !=(other) = not_eq(other)

#<(other) ⇒ Object



67
# File 'lib/tradingview_screener/predicate.rb', line 67

def <(other) = lt(other)

#<=(other) ⇒ Object



68
# File 'lib/tradingview_screener/predicate.rb', line 68

def <=(other) = lte(other)

#==(other) ⇒ Object



69
# File 'lib/tradingview_screener/predicate.rb', line 69

def ==(other) = eq(other)

#>(other) ⇒ Object



65
# File 'lib/tradingview_screener/predicate.rb', line 65

def >(other) = gt(other)

#>=(other) ⇒ Object



66
# File 'lib/tradingview_screener/predicate.rb', line 66

def >=(other) = gte(other)

#between(min, max) ⇒ Object



51
# File 'lib/tradingview_screener/predicate.rb', line 51

def between(min, max) = Predicate.new(name, "in_range", [unwrap(min), unwrap(max)])

#blankObject



59
# File 'lib/tradingview_screener/predicate.rb', line 59

def blank = Predicate.new(name, "empty", nil)

#crosses(other) ⇒ Object



61
# File 'lib/tradingview_screener/predicate.rb', line 61

def crosses(other) = Predicate.new(name, "crosses", other)

#crosses_above(other) ⇒ Object



62
# File 'lib/tradingview_screener/predicate.rb', line 62

def crosses_above(other) = Predicate.new(name, "crosses_above", other)

#crosses_below(other) ⇒ Object



63
# File 'lib/tradingview_screener/predicate.rb', line 63

def crosses_below(other) = Predicate.new(name, "crosses_below", other)

#does_not_match(value) ⇒ Object



58
# File 'lib/tradingview_screener/predicate.rb', line 58

def does_not_match(value) = Predicate.new(name, "nmatch", value)

#eq(other) ⇒ Object



49
# File 'lib/tradingview_screener/predicate.rb', line 49

def eq(other) = Predicate.new(name, "equal", other)

#gt(other) ⇒ Object



45
# File 'lib/tradingview_screener/predicate.rb', line 45

def gt(other) = Predicate.new(name, "greater", other)

#gte(other) ⇒ Object



46
# File 'lib/tradingview_screener/predicate.rb', line 46

def gte(other) = Predicate.new(name, "egreater", other)

#has(values) ⇒ Object



55
# File 'lib/tradingview_screener/predicate.rb', line 55

def has(values) = Predicate.new(name, "has", values)

#has_none_of(values) ⇒ Object



56
# File 'lib/tradingview_screener/predicate.rb', line 56

def has_none_of(values) = Predicate.new(name, "has_none_of", values)

#in(values) ⇒ Object



53
# File 'lib/tradingview_screener/predicate.rb', line 53

def in(values) = Predicate.new(name, "in_range", Array(values))

#inspectObject



72
73
74
# File 'lib/tradingview_screener/predicate.rb', line 72

def inspect
  "#<#{self.class} #{name}>"
end

#lt(other) ⇒ Object



47
# File 'lib/tradingview_screener/predicate.rb', line 47

def lt(other) = Predicate.new(name, "less", other)

#lte(other) ⇒ Object



48
# File 'lib/tradingview_screener/predicate.rb', line 48

def lte(other) = Predicate.new(name, "eless", other)

#matches(value) ⇒ Object



57
# File 'lib/tradingview_screener/predicate.rb', line 57

def matches(value) = Predicate.new(name, "match", value)

#not_between(min, max) ⇒ Object



52
# File 'lib/tradingview_screener/predicate.rb', line 52

def not_between(min, max) = Predicate.new(name, "not_in_range", [unwrap(min), unwrap(max)])

#not_eq(other) ⇒ Object



50
# File 'lib/tradingview_screener/predicate.rb', line 50

def not_eq(other) = Predicate.new(name, "nequal", other)

#not_in(values) ⇒ Object



54
# File 'lib/tradingview_screener/predicate.rb', line 54

def not_in(values) = Predicate.new(name, "not_in_range", Array(values))

#presentObject



60
# File 'lib/tradingview_screener/predicate.rb', line 60

def present = Predicate.new(name, "nempty", nil)