Class: Rjq::AST::Optional
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Attributes inherited from Node
Instance Method Summary collapse
- #eval(input, context) ⇒ Object
-
#initialize(node) ⇒ Optional
constructor
A new instance of Optional.
Methods inherited from Node
#assign_value, #invalid_path_message, #paths, #take, #with_source_span
Constructor Details
#initialize(node) ⇒ Optional
Returns a new instance of Optional.
616 617 618 |
# File 'lib/rjq/ast.rb', line 616 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
614 615 616 |
# File 'lib/rjq/ast.rb', line 614 def node @node end |
Instance Method Details
#eval(input, context) ⇒ Object
620 621 622 623 624 |
# File 'lib/rjq/ast.rb', line 620 def eval(input, context) @node.eval(input, context) rescue Rjq::RuntimeError [] end |