<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Class: XmlStore</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Class</strong></td> <td class="class-name-in-header">XmlStore</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../files/lib/storage/xmlstore_rb.html"> lib/storage/xmlstore.rb </a> <br /> </td> </tr> <tr class="top-aligned-row"> <td><strong>Parent:</strong></td> <td> <a href="Store.html"> Store </a> </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="diagram"> <map id="map" name="map"> <area shape="RECT" coords="33,113,105,161" href="XmlStore.html" alt="XmlStore "> <area shape="RECT" coords="33,17,105,65" href="Store.html" alt="Store "> </map> <img src="../dot/f_52.png" usemap="#map" border=0 alt="TopLevel"> </div> <div id="description"> <p> The <a href="XmlStore.html">XmlStore</a> class manages access to all object storage. </p> <dl> <dt><tt>db</tt></dt><dd>is a handle to the database implementation (in this iteration a hash). </dd> <dt><tt>dbtop</tt></dt><dd>stores the highest id used in the database. </dd> </dl> </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000064">check</a> <a href="#M000062">delete</a> <a href="#M000065">each</a> <a href="#M000063">get</a> <a href="#M000059">new</a> <a href="#M000061">put</a> <a href="#M000060">save</a> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> <div id="method-M000059" class="method-detail"> <a name="M000059"></a> <div class="method-heading"> <a href="XmlStore.src/M000059.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000059.html');return false;"> <span class="method-name">new</span><span class="method-args">(dbfile)</span> </a> </div> <div class="method-description"> </div> </div> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000064" class="method-detail"> <a name="M000064"></a> <div class="method-heading"> <a href="XmlStore.src/M000064.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000064.html');return false;"> <span class="method-name">check</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Check if an object is in the database by its id. </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to use in the search. </dd> <dt><tt>return</tt></dt><dd>true or false </dd> </dl> </div> </div> <div id="method-M000062" class="method-detail"> <a name="M000062"></a> <div class="method-heading"> <a href="XmlStore.src/M000062.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000062.html');return false;"> <span class="method-name">delete</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Deletes an object from the database. </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to to be deleted. </dd> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000065" class="method-detail"> <a name="M000065"></a> <div class="method-heading"> <a href="XmlStore.src/M000065.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000065.html');return false;"> <span class="method-name">each</span><span class="method-args">(&blk)</span> </a> </div> <div class="method-description"> <p> Iterate through all objects </p> <dl> <dt><tt>yield</tt></dt><dd>Each object in database to block of caller. </dd> </dl> </div> </div> <div id="method-M000063" class="method-detail"> <a name="M000063"></a> <div class="method-heading"> <a href="XmlStore.src/M000063.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000063.html');return false;"> <span class="method-name">get</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Finds an object in the database by its id. </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to use in the search. </dd> <dt><tt>return</tt></dt><dd>Handle to the object or nil. </dd> </dl> </div> </div> <div id="method-M000061" class="method-detail"> <a name="M000061"></a> <div class="method-heading"> <a href="XmlStore.src/M000061.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000061.html');return false;"> <span class="method-name">put</span><span class="method-args">(obj)</span> </a> </div> <div class="method-description"> <p> Adds a new object to the database. </p> <dl> <dt><tt>obj</tt></dt><dd>is a reference to object to be added </dd> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000060" class="method-detail"> <a name="M000060"></a> <div class="method-heading"> <a href="XmlStore.src/M000060.html" target="Code" class="method-signature" onclick="popupCode('XmlStore.src/M000060.html');return false;"> <span class="method-name">save</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Save the world </p> <dl> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>