tmud-3.0.0/benchmark/
tmud-3.0.0/cmd/
tmud-3.0.0/cmd/objects/
tmud-3.0.0/cmd/tiny/
tmud-3.0.0/doc/SQLite/
tmud-3.0.0/doc/SQLite3/
tmud-3.0.0/doc/TernaryTrie/
tmud-3.0.0/farts/
tmud-3.0.0/lib/
tmud-3.0.0/lib/engine/
tmud-3.0.0/lib/farts/
tmud-3.0.0/logs/
<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>class Module - TeensyMUD 3.0.0 Mud Server</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body id="top" class="class">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>lib/storage/properties.rb
    <li>lib/utility/configuration.rb
    <li>lib/utility/log.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    <nav id="parent-class-section" class="section">
  <h3 class="section-header">Parent</h3>
  
  <p class="link"><a href="Object.html">Object</a>
  
</nav>

    
    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-i-configuration">#configuration</a>
    
    <li><a href="#method-i-logger">#logger</a>
    
    <li><a href="#method-i-property">#property</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./README.html">README</a>
  
    <li class="file"><a href="./TML.html">TML</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./Farts.html">Farts</a>
  
    <li><a href="./Farts/AttributeSyntaxNode.html">Farts::AttributeSyntaxNode</a>
  
    <li><a href="./Farts/CallSyntaxNode.html">Farts::CallSyntaxNode</a>
  
    <li><a href="./Farts/CommandSyntaxNode.html">Farts::CommandSyntaxNode</a>
  
    <li><a href="./Farts/CommentSyntaxNode.html">Farts::CommentSyntaxNode</a>
  
    <li><a href="./Farts/EndSyntaxNode.html">Farts::EndSyntaxNode</a>
  
    <li><a href="./Farts/IfSyntaxNode.html">Farts::IfSyntaxNode</a>
  
    <li><a href="./Farts/Interpreter.html">Farts::Interpreter</a>
  
    <li><a href="./Farts/Lexer.html">Farts::Lexer</a>
  
    <li><a href="./Farts/Lib.html">Farts::Lib</a>
  
    <li><a href="./Farts/LiteralSyntaxNode.html">Farts::LiteralSyntaxNode</a>
  
    <li><a href="./Farts/LocalVarSyntaxNode.html">Farts::LocalVarSyntaxNode</a>
  
    <li><a href="./Farts/Parser.html">Farts::Parser</a>
  
    <li><a href="./Farts/ProgramSyntaxNode.html">Farts::ProgramSyntaxNode</a>
  
    <li><a href="./Farts/SyntaxNode.html">Farts::SyntaxNode</a>
  
    <li><a href="./SQLite.html">SQLite</a>
  
    <li><a href="./SQLite3.html">SQLite3</a>
  
    <li><a href="./SQLite3/Database.html">SQLite3::Database</a>
  
    <li><a href="./SQLite/Database.html">SQLite::Database</a>
  
    <li><a href="./TernaryTrie.html">TernaryTrie</a>
  
    <li><a href="./TernaryTrie/TNode.html">TernaryTrie::TNode</a>
  
    <li><a href="./ASCIICodes.html">ASCIICodes</a>
  
    <li><a href="./Acceptor.html">Acceptor</a>
  
    <li><a href="./Account.html">Account</a>
  
    <li><a href="./BoolExpParser.html">BoolExpParser</a>
  
    <li><a href="./CacheEntry.html">CacheEntry</a>
  
    <li><a href="./CacheManager.html">CacheManager</a>
  
    <li><a href="./CacheStats.html">CacheStats</a>
  
    <li><a href="./Character.html">Character</a>
  
    <li><a href="./Client.html">Client</a>
  
    <li><a href="./Cmd.html">Cmd</a>
  
    <li><a href="./ColorFilter.html">ColorFilter</a>
  
    <li><a href="./Command.html">Command</a>
  
    <li><a href="./Configuration.html">Configuration</a>
  
    <li><a href="./Connection.html">Connection</a>
  
    <li><a href="./Connector.html">Connector</a>
  
    <li><a href="./ConsoleClient.html">ConsoleClient</a>
  
    <li><a href="./CursesClient.html">CursesClient</a>
  
    <li><a href="./DbmStore.html">DbmStore</a>
  
    <li><a href="./DebugFilter.html">DebugFilter</a>
  
    <li><a href="./Dumper.html">Dumper</a>
  
    <li><a href="./Engine.html">Engine</a>
  
    <li><a href="./Event.html">Event</a>
  
    <li><a href="./EventManager.html">EventManager</a>
  
    <li><a href="./Exit.html">Exit</a>
  
    <li><a href="./Filter.html">Filter</a>
  
    <li><a href="./GameObject.html">GameObject</a>
  
    <li><a href="./GdbmStore.html">GdbmStore</a>
  
    <li><a href="./LineIO.html">LineIO</a>
  
    <li><a href="./Loader.html">Loader</a>
  
    <li><a href="./Log.html">Log</a>
  
    <li><a href="./Module.html">Module</a>
  
    <li><a href="./Obj.html">Obj</a>
  
    <li><a href="./ObjCmd.html">ObjCmd</a>
  
    <li><a href="./Object.html">Object</a>
  
    <li><a href="./PacketIO.html">PacketIO</a>
  
    <li><a href="./ProtocolStack.html">ProtocolStack</a>
  
    <li><a href="./Publisher.html">Publisher</a>
  
    <li><a href="./Reactor.html">Reactor</a>
  
    <li><a href="./Room.html">Room</a>
  
    <li><a href="./Root.html">Root</a>
  
    <li><a href="./Script.html">Script</a>
  
    <li><a href="./SdbmStore.html">SdbmStore</a>
  
    <li><a href="./Session.html">Session</a>
  
    <li><a href="./SockIO.html">SockIO</a>
  
    <li><a href="./Sqlite3Store.html">Sqlite3Store</a>
  
    <li><a href="./SqliteStore.html">SqliteStore</a>
  
    <li><a href="./Store.html">Store</a>
  
    <li><a href="./String.html">String</a>
  
    <li><a href="./TelnetCodes.html">TelnetCodes</a>
  
    <li><a href="./TelnetFilter.html">TelnetFilter</a>
  
    <li><a href="./TerminalFilter.html">TerminalFilter</a>
  
    <li><a href="./Timer.html">Timer</a>
  
    <li><a href="./Utility.html">Utility</a>
  
    <li><a href="./VT100Codes.html">VT100Codes</a>
  
    <li><a href="./World.html">World</a>
  
    <li><a href="./XmlStore.html">XmlStore</a>
  
    <li><a href="./YamlStore.html">YamlStore</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="class">class Module</h1>

  <div id="description" class="description">
    
  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-configuration" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">configuration</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>configure adds the options method to a class which allows it to access the
global configuration hash.</p>
<dl class="rdoc-list label-list"><dt><code>name</code>
<dd>
<p>an arrays of symbols representing the attributes on the object.</p>
</dd></dl>
          

          
          <div class="method-source-code" id="configuration-source">
            <pre><span class="ruby-comment"># File lib/utility/configuration.rb, line 51</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">configuration</span>()
    <span class="ruby-identifier">class_eval</span> <span class="ruby-string">&quot;      def options
        Configuration.instance.options
      end
&quot;</span>
  <span class="ruby-keyword">end</span></pre>
          </div><!-- configuration-source -->
          
        </div>

        

        
      </div><!-- configuration-method -->

    
      <div id="method-i-logger" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">logger</span><span
            class="method-args">(loglevel='DEBUG', logto=['stderr','server'])</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>logger defines a named log and log method for the class</p>
<dl class="rdoc-list label-list"><dt><code>loglevel</code>
<dd>
<p>the level of logging to do</p>
</dd></dl>
          

          
          <div class="method-source-code" id="logger-source">
            <pre><span class="ruby-comment"># File lib/utility/log.rb, line 53</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">logger</span>(<span class="ruby-identifier">loglevel</span>=<span class="ruby-string">'DEBUG'</span>, <span class="ruby-identifier">logto</span>=[<span class="ruby-string">'stderr'</span>,<span class="ruby-string">'server'</span>])
    <span class="ruby-identifier">class_eval</span> <span class="ruby-string">&quot;      @log = Log.instance.loginit(self.name, &quot;#{loglevel}&quot;, #{logto.inspect})
      def log
        self.class.instance_variable_get :@log
      end
&quot;</span>
  <span class="ruby-keyword">end</span></pre>
          </div><!-- logger-source -->
          
        </div>

        

        
      </div><!-- logger-method -->

    
      <div id="method-i-property" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">property</span><span
            class="method-args">(*sym)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Properties modifies class <a href="Module.html">Module</a> by adding the
property method which:</p>
<ol><li>
<p>creates read/write accessors for each symbol.</p>
</li><li>
<p>defines the to_yaml_properties for use by the database for all symbols.</p>
</li><li>
<p>defines the :id attribute</p>
</li></ol>
<dl class="rdoc-list label-list"><dt><code>sym</code>
<dd>
<p>an arrays of symbols representing the attributes on the object.</p>
</dd></dl>
          

          
          <div class="method-source-code" id="property-source">
            <pre><span class="ruby-comment"># File lib/storage/properties.rb, line 26</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">property</span>(*<span class="ruby-identifier">sym</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">options</span>[<span class="ruby-string">'props_are_accessors_only'</span>]
      <span class="ruby-identifier">attr_accessor</span>(*<span class="ruby-identifier">sym</span>)
<span class="ruby-comment">      class_eval &lt;&lt;-EOD
        def id
          @id ||= Engine.instance.db.getid
        end
      EOD
</span>      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">sym</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">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-string">&quot;        def #{s}
          @props ||= {}
          if options['safe_read'] &amp;&amp; !@props[:#{s}].kind_of?(Numeric)
            Engine.instance.db.mark(self.id)
            @props[:updated_on] = Time.now
          end
          @props[:#{s}]
        end
        def #{s}=(val)
          @props ||= {}
          Engine.instance.db.mark(self.id)
          @props[:updated_on] = Time.now
          @props[:#{s}] = val
        end
&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">class_eval</span> <span class="ruby-string">&quot;      def to_yaml_properties
        ['@props']
      end
      def id
        @props ||= {}
        @props[:id] ||= Engine.instance.db.getid
      end
      def _dump(depth)
        Marshal.dump(@props)
      end
      def self._load(str)
        obj = allocate
        obj.instance_variable_set(:@props,Marshal.load(str))
        obj
      end
&quot;</span>
  <span class="ruby-keyword">end</span></pre>
          </div><!-- property-source -->
          
        </div>

        

        
      </div><!-- property-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>