Class: ConceptQL::Tree
- Inherits:
-
Object
- Object
- ConceptQL::Tree
- Defined in:
- lib/conceptql/tree.rb
Instance Attribute Summary collapse
-
#nodifier ⇒ Object
readonly
Returns the value of attribute nodifier.
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.
7 8 9 10 |
# File 'lib/conceptql/tree.rb', line 7 def initialize(opts = {}) @nodifier = opts.fetch(:nodifier, Nodifier.new) @behavior = opts.fetch(:behavior, nil) end |
Instance Attribute Details
#nodifier ⇒ Object (readonly)
Returns the value of attribute nodifier.
6 7 8 |
# File 'lib/conceptql/tree.rb', line 6 def nodifier @nodifier end |
Instance Method Details
#root(query) ⇒ Object
12 13 14 |
# File 'lib/conceptql/tree.rb', line 12 def root(query) @root ||= traverse(query.statement.symbolize_keys) end |