Class: ConceptQL::Tree

Inherits:
Object
  • Object
show all
Defined in:
lib/conceptql/tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nodifierObject (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