<ppdoc>
<copyright>
    Copyright (c) 2001 by Addison Wesley Longman.  This
    material may be distributed only subject to the terms and
    conditions set forth in the Open Publication License, v1.0 or
    later (the latest version is presently available at
    http://www.opencontent.org/openpub/).
</copyright>
<class name="NilClass" super="Object" type="class" ref="xref-000001">
    The class of the singleton object <tt>nil</tt>.
<p/>
  <methods type="instance">
        <method name="&amp;" ref="_et">
      <callseq>
        <tt>nil</tt>&amp; <obj>anObject</obj>
        <returns><const>false</const></returns>
      </callseq>
      <desc>
<p/>
      And---Returns <const>false</const>. As <obj>anObject</obj> is an
      argument to a method call, it is always evaluated; there is no
      short-circuit evaluation in this case.
<p/>
<codefragment>
<alltt><fullcode><![CDATA[        nil && puts("logical and")
        nil &  puts("and")
]]></fullcode>
nil<nbsp/>&amp;&amp;<nbsp/>puts("logical<nbsp/>and")
nil<nbsp/>&amp;<nbsp/><nbsp/>puts("and")
</alltt>
</codefragment>
<em>produces:</em>
<codefragment><alltt>
and
</alltt>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="^" ref="_up">
      <callseq>
        <tt>nil</tt>^ <obj>anObject</obj>
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Exclusive Or---Returns <const>false</const> if <obj>anObject</obj> is <const>nil</const> or
      <const>false</const>, 
      <const>true</const> otherwise.
<p/>
      </desc>
    </method>
<p/>
        <method name="|" ref="_ba">
      <callseq>
        <tt>nil</tt>| <obj>anObject</obj>
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Or---Returns <const>false</const> if <obj>anObject</obj> is
      <const>nil</const> or <const>false</const>, <const>true</const> otherwise.
<p/>
      </desc>
    </method>
<p/>
        <method name="nil?" ref="nil_qm">
      <callseq>
        <tt>nil</tt>.nil? <returns><const>true</const></returns>
      </callseq>
      <desc>
<p/>
      Always returns <const>true</const>.
<p/>
      </desc>
    </method>
<p/>
        <method name="to_a" ref="to_a">
      <callseq>
        <tt>nil</tt>.to_a <returns>[]</returns>
      </callseq>
      <desc>
<p/>
      Always returns an empty array.
<p/>
      </desc>
    </method>
<p/>
        <method name="to_i" ref="to_i">
      <callseq>
        <tt>nil</tt>.to_i <returns>0</returns>
      </callseq>
      <desc>
<p/>
      Always returns zero.
<p/>
      </desc>
    </method>
<p/>
        <method name="to_s" ref="to_s">
      <callseq>
        <tt>nil</tt>.to_s <returns>""</returns>
      </callseq>
      <desc>
<p/>
      Always returns the empty string.
<p/>
      </desc>
    </method>
<p/>
  </methods>
<p/>
</class>
</ppdoc>
