Class: ConceptQL::Tree
- Inherits:
-
Object
- Object
- ConceptQL::Tree
- Defined in:
- lib/conceptql/tree.rb
Overview
Tree is used to walk through a ConceptQL statement, instantiate all operators, and then provide access to the root operator
Instance Attribute Summary collapse
-
#behavior ⇒ Object
readonly
Returns the value of attribute behavior.
-
#defined ⇒ Object
readonly
Returns the value of attribute defined.
-
#nodifier ⇒ Object
readonly
Returns the value of attribute nodifier.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#temp_tables ⇒ Object
readonly
Returns the value of attribute temp_tables.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Tree
constructor
A new instance of Tree.
- #root(query) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Tree
Returns a new instance of Tree.
12 13 14 15 16 17 18 19 |
# File 'lib/conceptql/tree.rb', line 12 def initialize(opts = {}) @nodifier = opts.fetch(:nodifier, Nodifier.new) @behavior = opts.fetch(:behavior, nil) @defined = {} @temp_tables = {} @opts = {} @scope = opts.fetch(:scope, Scope.new) end |
Instance Attribute Details
#behavior ⇒ Object (readonly)
Returns the value of attribute behavior.
11 12 13 |
# File 'lib/conceptql/tree.rb', line 11 def behavior @behavior end |
#defined ⇒ Object (readonly)
Returns the value of attribute defined.
11 12 13 |
# File 'lib/conceptql/tree.rb', line 11 def defined @defined end |
#nodifier ⇒ Object (readonly)
Returns the value of attribute nodifier.
11 12 13 |
# File 'lib/conceptql/tree.rb', line 11 def nodifier @nodifier end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
11 12 13 |
# File 'lib/conceptql/tree.rb', line 11 def opts @opts end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
11 12 13 |
# File 'lib/conceptql/tree.rb', line 11 def scope @scope end |
#temp_tables ⇒ Object (readonly)
Returns the value of attribute temp_tables.
11 12 13 |
# File 'lib/conceptql/tree.rb', line 11 def temp_tables @temp_tables end |
Instance Method Details
#root(query) ⇒ Object
21 22 23 |
# File 'lib/conceptql/tree.rb', line 21 def root(query) @root ||= start_traverse(query.statement) end |