tmud-2.10.1/benchmark/
tmud-2.10.1/cmd/
tmud-2.10.1/cmd/objects/
tmud-2.10.1/cmd/tiny/
tmud-2.10.1/doc/classes/SQLite/
tmud-2.10.1/doc/classes/SQLite3/
tmud-2.10.1/doc/classes/TernaryTrie/
tmud-2.10.1/doc/files/cmd/objects/
tmud-2.10.1/doc/files/cmd/tiny/
tmud-2.10.1/doc/files/lib/
tmud-2.10.1/doc/files/lib/engine/
tmud-2.10.1/doc/files/lib/farts/
tmud-2.10.1/farts/
tmud-2.10.1/lib/
tmud-2.10.1/lib/core/
tmud-2.10.1/lib/engine/
tmud-2.10.1/lib/farts/
tmud-2.10.1/logs/
<?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: Module</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">Module</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/lib/storage/properties_rb.html">
                lib/storage/properties.rb
                </a>
        <br />
                <a href="../files/lib/utility/configuration_rb.html">
                lib/utility/configuration.rb
                </a>
        <br />
                <a href="../files/lib/utility/log_rb.html">
                lib/utility/log.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">
    <div id="diagram">
      <map id="map" name="map">
  <area shape="rect" coords="5,5,77,53"      href="Module.html" alt="Module
" />
  <area shape="rect" coords="149,101,221,149"      href="Log.html" alt="Log
" />
  <area shape="rect" coords="101,5,173,53"      href="Singleton.html" alt="Singleton
" />
  <area shape="rect" coords="197,5,269,53"      href="Log4r.html" alt="Log4r
" />
</map>
<img src="../dot/f_56.png" usemap="#map" border="0" alt="dot/f_56.png">
    </div>



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000089">configuration</a>&nbsp;&nbsp;
      <a href="#M000090">logger</a>&nbsp;&nbsp;
      <a href="#M000088">property</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000089" class="method-detail">
        <a name="M000089"></a>

        <div class="method-heading">
          <a href="#M000089" class="method-signature">
          <span class="method-name">configuration</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
configure adds the options method to a class which allows it to access the
global <a href="Module.html#M000089">configuration</a> hash.
</p>
<dl>
<dt><tt>name</tt></dt><dd>an arrays of symbols representing the attributes on the object.

</dd>
</dl>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000089-source">
<pre>
<span class="ruby-comment cmt"># File lib/utility/configuration.rb, line 51</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configuration</span>()
    <span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def options\nConfiguration.instance.options\nend\n&quot;</span>
  <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000090" class="method-detail">
        <a name="M000090"></a>

        <div class="method-heading">
          <a href="#M000090" class="method-signature">
          <span class="method-name">logger</span><span class="method-args">(loglevel='DEBUG', logto=['stderr','server'])</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
<a href="Module.html#M000090">logger</a> defines a named log and log method
for the class
</p>
<dl>
<dt><tt>loglevel</tt></dt><dd>the level of logging to do

</dd>
</dl>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000090-source">
<pre>
<span class="ruby-comment cmt"># File lib/utility/log.rb, line 53</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>(<span class="ruby-identifier">loglevel</span>=<span class="ruby-value str">'DEBUG'</span>, <span class="ruby-identifier">logto</span>=[<span class="ruby-value str">'stderr'</span>,<span class="ruby-value str">'server'</span>])
    <span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;@log = Log.instance.loginit(self.name, \&quot;\#{loglevel}\&quot;, \#{logto.inspect})\ndef log\nself.class.instance_variable_get :@log\nend\n&quot;</span>
  <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000088" class="method-detail">
        <a name="M000088"></a>

        <div class="method-heading">
          <a href="#M000088" class="method-signature">
          <span class="method-name">property</span><span class="method-args">(*sym)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Properties modifies class <a href="Module.html">Module</a> by adding the <a
href="Module.html#M000088">property</a> method which:
</p>
<ol>
<li>creates read/write accessors for each symbol.

</li>
<li>defines the to_yaml_properties for use by the database for all symbols.

</li>
<li>defines the :id attribute

</li>
</ol>
<dl>
<dt><tt>sym</tt></dt><dd>an arrays of symbols representing the attributes on the object.

</dd>
</dl>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000088-source">
<pre>
<span class="ruby-comment cmt"># File lib/storage/properties.rb, line 26</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">property</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">sym</span>)
    <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">options</span>[<span class="ruby-value str">'props_are_accessors_only'</span>]
      <span class="ruby-identifier">attr_accessor</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">sym</span>)
??
      <span class="ruby-keyword kw">return</span>
    <span class="ruby-keyword kw">end</span>
    <span class="ruby-identifier">sym</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def \#{s}\n@props ||= {}\nif options['safe_read'] &amp;&amp; !@props[:\#{s}].kind_of?(Numeric)\nEngine.instance.db.mark(self.id)\n@props[:updated_on] = Time.now\nend\n@props[:\#{s}]\nend\ndef \#{s}=(val)\n@props ||= {}\nEngine.instance.db.mark(self.id)\n@props[:updated_on] = Time.now\n@props[:\#{s}] = val\nend\n&quot;</span>
    <span class="ruby-keyword kw">end</span>
    <span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def to_yaml_properties\n['@props']\nend\ndef id\n@props ||= {}\n@props[:id] ||= Engine.instance.db.getid\nend\ndef _dump(depth)\nMarshal.dump(@props)\nend\ndef self._load(str)\nobj = allocate\nobj.instance_variable_set(:@props,Marshal.load(str))\nobj\nend\n&quot;</span>
  <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </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>