<?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>
  <head>
    <title>File: recorder.rb</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />

    <script language="JavaScript" type="text/javascript">
    // <![CDATA[

        function toggleSource( id )
        {
          var elem
          var link

          if( document.getElementById )
          {
            elem = document.getElementById( id )
            link = document.getElementById( "l_" + id )
          }
          else if ( document.all )
          {
            elem = eval( "document.all." + id )
            link = eval( "document.all.l_" + id )
          }
          else
            return false;

          if( elem.style.display == "block" )
          {
            elem.style.display = "none"
            link.innerHTML = "show source"
          }
          else
          {
            elem.style.display = "block"
            link.innerHTML = "hide source"
          }
        }

        function openCode( url )
        {
          window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
        }
      // ]]>
    </script>
  </head>

  <body>
  <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
  <tr><td>
    <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
      <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />recorder.rb</td>
      <td align="right">
        <table border='0' cellspacing="0" cellpadding="2">
          <tr>
            <td>Path:</td>
            <td>lib/more/facets/recorder.rb
            </td>
          </tr>
          <tr>
            <td>Modified:</td>
            <td>Sun Aug 10 08:48:43 -0400 2008</td>
          </tr>
        </table>
      </td></tr>
    </table>
  </td></tr>
</table><br />
 <!-- banner header -->

  <div id="bodyContent">
      <div id="content">

  <div class="description"><h1><a href="../../../../classes/Recorder.html">Recorder</a></h1>
<h2>Synopsis</h2>
<p>
<a href="../../../../classes/Recorder.html">Recorder</a> is similar
essentially a method probe. <a href="../../../../classes/It.html">It</a>
records everthing that happens to it, building an internal parse tree. You
can then pass a substitute object and apply the recoding to it. Or you can
utilize the parse tree.
</p>
<p>
The only limitation of <a
href="../../../../classes/Recorder.html">Recorder</a> is with special
operators, like if, &amp;&amp;, ||, etc. Since they are not true methods
they can&#8216;t be recorded. (Too bad for Ruby.)
</p>
<h2>Usage</h2>
<pre>
  class Z
    def name ; 'George' ; end
    def age ; 12 ; end
  end

  z = Z.new

  r = Recorder.new
  q = proc { |x| (x.name == 'George') &amp; (x.age &gt; 10) }
  x = q[r]
  x.__call__(z)
</pre>
<p>
produces
</p>
<pre>
  true
</pre>
<h2>Authors</h2>
<ul>
<li>Thomas Sawyer

</li>
</ul>
<h2>Copying</h2>
<p>
Copyright (c) 2006 Thomas Sawyer
</p>
<p>
Ruby License
</p>
<p>
This module is free software. You may use, modify, and/or redistribute this
software under the same terms as Ruby.
</p>
<p>
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
</p>
</div>

  <div class="sectiontitle">Required Files</div>
  <ul>
  <li>facets/kernel/object_class</li>
  </ul>








</div>

  </div>

    </body>
</html>