Class: Rjq::AST::ScopedDefinition
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Attributes inherited from Node
Instance Method Summary collapse
- #eval(input, context) ⇒ Object
-
#initialize(definition, body) ⇒ ScopedDefinition
constructor
A new instance of ScopedDefinition.
Methods inherited from Node
#assign_value, #invalid_path_message, #paths, #take, #with_source_span
Constructor Details
#initialize(definition, body) ⇒ ScopedDefinition
Returns a new instance of ScopedDefinition.
144 145 146 147 |
# File 'lib/rjq/ast.rb', line 144 def initialize(definition, body) @definition = definition @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
142 143 144 |
# File 'lib/rjq/ast.rb', line 142 def body @body end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
142 143 144 |
# File 'lib/rjq/ast.rb', line 142 def definition @definition end |
Instance Method Details
#eval(input, context) ⇒ Object
149 150 151 |
# File 'lib/rjq/ast.rb', line 149 def eval(input, context) @body.eval(input, apply_definition(context)) end |