Class: Dentaku::AST::StringFunctions::Contains
- Defined in:
- lib/dentaku/ast/functions/string_functions.rb
Constant Summary
Constants inherited from Function
Instance Method Summary collapse
-
#initialize(*args) ⇒ Contains
constructor
A new instance of Contains.
- #type ⇒ Object
- #value(context = {}) ⇒ Object
Methods inherited from Base
Methods inherited from Function
#dependencies, get, numeric, register, register_class, registry
Methods inherited from Node
arity, #dependencies, peek, precedence
Constructor Details
#initialize(*args) ⇒ Contains
Returns a new instance of Contains.
124 125 126 127 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 124 def initialize(*args) super @needle, @haystack = *args end |
Instance Method Details
#type ⇒ Object
133 134 135 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 133 def type :logical end |
#value(context = {}) ⇒ Object
129 130 131 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 129 def value(context = {}) @haystack.value(context).to_s.include? @needle.value(context).to_s end |