Module: RTM::TMQL::Queryable

Defined in:
lib/rtm/tmql.rb

Instance Method Summary collapse

Instance Method Details

#execute_tmql(query) ⇒ Object

Execute a TMQL query with the default engine



27
28
29
# File 'lib/rtm/tmql.rb', line 27

def execute_tmql(query)
  tmql_engine.execute(query)
end

#tmql(query = nil) ⇒ Object

Initialize a TMQL engine and run query instantly if a query is provided



18
19
20
21
22
23
24
# File 'lib/rtm/tmql.rb', line 18

def tmql(query=nil)
  if query
    execute_tmql(query)
  else
    tmql_engine
  end
end

#tmql_engine(params = {}) ⇒ Object

Initialize a TMQL engine



32
33
34
# File 'lib/rtm/tmql.rb', line 32

def tmql_engine(params={})
  @tmql_engine ||= TMQL::Engine.create({:construct => self}.merge(params))
end