Class: Rjq::AST::Program
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
-
#directives ⇒ Object
readonly
Returns the value of attribute directives.
Attributes inherited from Node
Instance Method Summary collapse
- #context_with_definitions(context) ⇒ Object
- #eval(input, context) ⇒ Object
-
#initialize(body, definitions = [], directives = []) ⇒ Program
constructor
A new instance of Program.
Methods inherited from Node
#assign_value, #invalid_path_message, #paths, #take, #with_source_span
Constructor Details
#initialize(body, definitions = [], directives = []) ⇒ Program
Returns a new instance of Program.
95 96 97 98 99 |
# File 'lib/rjq/ast.rb', line 95 def initialize(body, definitions = [], directives = []) @body = body @definitions = definitions @directives = directives end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
93 94 95 |
# File 'lib/rjq/ast.rb', line 93 def body @body end |
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
93 94 95 |
# File 'lib/rjq/ast.rb', line 93 def definitions @definitions end |
#directives ⇒ Object (readonly)
Returns the value of attribute directives.
93 94 95 |
# File 'lib/rjq/ast.rb', line 93 def directives @directives end |
Instance Method Details
#context_with_definitions(context) ⇒ Object
105 106 107 |
# File 'lib/rjq/ast.rb', line 105 def context_with_definitions(context) apply_definitions(context) end |
#eval(input, context) ⇒ Object
101 102 103 |
# File 'lib/rjq/ast.rb', line 101 def eval(input, context) body.eval(input, context_with_definitions(context)) end |