Class: Dbxml::XmlManager
- Inherits:
-
Object
- Object
- Dbxml::XmlManager
- Defined in:
- lib/rdbxml.rb
Overview
Instance Method Summary collapse
-
#[](name) ⇒ Object
Opens the container named
name
, creating it if it doesn’t exist. -
#query(xquery, opts = {}, &block) ⇒ Object
Runs the query
xquery
, creating a query context if necessary or usingopts[:ctx]
if passed.
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 |