Class: ConceptQL::Query

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db, statement, tree = Tree.new) ⇒ Query

Returns a new instance of Query.



8
9
10
11
12
# File 'lib/conceptql/query.rb', line 8

def initialize(db, statement, tree = Tree.new)
  @db = db
  @statement = statement
  @tree = tree
end

Instance Attribute Details

#statementObject (readonly)

Returns the value of attribute statement.



7
8
9
# File 'lib/conceptql/query.rb', line 7

def statement
  @statement
end

Instance Method Details

#executeObject



18
19
20
21
# File 'lib/conceptql/query.rb', line 18

def execute
  ensure_views
  build_query(db).all
end

#queryObject



14
15
16
# File 'lib/conceptql/query.rb', line 14

def query
  build_query(db)
end

#typesObject



23
24
25
# File 'lib/conceptql/query.rb', line 23

def types
  tree.root(self).types
end