Class: Dbxml::XmlManager

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

Overview

Wraps and extends the XmlManager class.

Aliases

create_query_context

createQueryContext

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object

Opens the container named name, creating it if it doesn’t exist.



238
239
240
# File 'lib/rdbxml.rb', line 238

def []( name )
  openContainer name.to_s, Dbxml::DB_CREATE
end

#query(xquery, opts = {}, &block) ⇒ Object

Runs the query xquery, creating a query context if necessary or using opts[:ctx] if passed.



244
245
246
247
248
249
250
251
# File 'lib/rdbxml.rb', line 244

def query( xquery, opts = {}, &block ) # :yeilds: result
  opts[:ctx] ||= create_query_context
  q = self.prepare xquery, opts[:ctx]
  res = q.execute( opts[:ctx], 0 )
#puts "#{xquery} -> #{res}"
  res.each(block)  if block_given?
  res
end