<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class RDoc::AnyMethod - RDoc Documentation</title>

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

<script src="../js/jquery.js"></script>
<script src="../js/darkfish.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">



<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    <div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  
  <p class="link"><a href="MethodAttr.html">RDoc::MethodAttr</a>
  
</div>

    <div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
  
  
    <li><a class="include" href="TokenStream.html">RDoc::TokenStream</a>
  
  
  </ul>
</div>

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

  <ul class="link-list" role="directory">
    
    <li class="calls-super" ><a href="#method-c-new">::new</a>
    
    <li ><a href="#method-i-add_alias">#add_alias</a>
    
    <li ><a href="#method-i-aref_prefix">#aref_prefix</a>
    
    <li ><a href="#method-i-arglists">#arglists</a>
    
    <li ><a href="#method-i-call_seq-3D">#call_seq=</a>
    
    <li ><a href="#method-i-marshal_dump">#marshal_dump</a>
    
    <li ><a href="#method-i-marshal_load">#marshal_load</a>
    
    <li ><a href="#method-i-name">#name</a>
    
    <li ><a href="#method-i-param_list">#param_list</a>
    
    <li ><a href="#method-i-param_seq">#param_seq</a>
    
    <li class="calls-super" ><a href="#method-i-store-3D">#store=</a>
    
    <li ><a href="#method-i-superclass_method">#superclass_method</a>
    
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-RDoc::AnyMethod">
  <h1 id="class-RDoc::AnyMethod" class="class">
    class RDoc::AnyMethod
  </h1>

  <section class="description">
    
<p><a href="AnyMethod.html">AnyMethod</a> is the base class for objects
representing methods</p>

  </section>

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

    

    

    
    <section class="attribute-method-details" class="method-section">
      <header>
        <h3>Attributes</h3>
      </header>

      
      <div id="attribute-i-c_function" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">c_function</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>The C function that implements this method (if it was defined in a C file)</p>
        
        </div>
      </div>
      
      <div id="attribute-i-call_seq" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">call_seq</span><span
            class="attribute-access-type">[R]</span>
        </div>

        <div class="method-description">
        
        <p>Different ways to call this method</p>
        
        </div>
      </div>
      
      <div id="attribute-i-calls_super" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">calls_super</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>If true this method uses <code>super</code> to call a superclass version</p>
        
        </div>
      </div>
      
      <div id="attribute-i-dont_rename_initialize" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">dont_rename_initialize</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>Don&#39;t rename #initialize to ::new</p>
        
        </div>
      </div>
      
      <div id="attribute-i-params" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">params</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>Parameters for this method</p>
        
        </div>
      </div>
      
    </section>
    

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

    
      <div id="method-c-new" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">(text, name)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>Creates a new <a href="AnyMethod.html">AnyMethod</a> with a token stream
<code>text</code> and <code>name</code></p>
          
          
            <div class="method-calls-super">
              Calls superclass method
              <a href="MethodAttr.html#method-c-new">RDoc::MethodAttr.new</a>
            </div>
          

          
          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 48</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">text</span>, <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">super</span>

  <span class="ruby-ivar">@c_function</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@dont_rename_initialize</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@token_stream</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@calls_super</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@superclass_method</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

    
      <div id="method-i-add_alias" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">add_alias</span><span
            class="method-args">(an_alias, context = nil)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>Adds <code>an_alias</code> as an alias for this method in
<code>context</code>.</p>
          
          

          
          <div class="method-source-code" id="add_alias-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 61</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_alias</span> <span class="ruby-identifier">an_alias</span>, <span class="ruby-identifier">context</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">method</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">an_alias</span>.<span class="ruby-identifier">text</span>, <span class="ruby-identifier">an_alias</span>.<span class="ruby-identifier">new_name</span>

  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">record_location</span> <span class="ruby-identifier">an_alias</span>.<span class="ruby-identifier">file</span>
  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">singleton</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">singleton</span>
  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">params</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">params</span>
  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">visibility</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">visibility</span>
  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">comment</span> = <span class="ruby-identifier">an_alias</span>.<span class="ruby-identifier">comment</span>
  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">is_alias_for</span> = <span class="ruby-keyword">self</span>
  <span class="ruby-ivar">@aliases</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">method</span>
  <span class="ruby-identifier">context</span>.<span class="ruby-identifier">add_method</span> <span class="ruby-identifier">method</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">context</span>
  <span class="ruby-identifier">method</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Prefix for <code>aref</code> is &#39;method&#39;.</p>
          
          

          
          <div class="method-source-code" id="aref_prefix-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 78</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">aref_prefix</span>
  <span class="ruby-string">&#39;method&#39;</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>The <a href="AnyMethod.html#attribute-i-call_seq">#call_seq</a> or the <a
href="AnyMethod.html#method-i-param_seq">#param_seq</a> with method name,
if there is no call_seq.</p>

<p>Use this for displaying a method&#39;s argument lists.</p>
          
          

          
          <div class="method-source-code" id="arglists-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 87</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">arglists</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@call_seq</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@call_seq</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@params</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;#{name}#{param_seq}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Sets the different ways you can call this method.  If an empty
<code>call_seq</code> is given nil is assumed.</p>

<p>See also <a href="AnyMethod.html#method-i-param_seq">param_seq</a></p>
          
          

          
          <div class="method-source-code" id="call_seq-3D-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 101</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">call_seq=</span> <span class="ruby-identifier">call_seq</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">call_seq</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-ivar">@call_seq</span> = <span class="ruby-identifier">call_seq</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Dumps this <a href="AnyMethod.html">AnyMethod</a> for use by ri.  See also
<a href="AnyMethod.html#method-i-marshal_load">marshal_load</a></p>
          
          

          
          <div class="method-source-code" id="marshal_dump-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 129</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">marshal_dump</span>
  <span class="ruby-identifier">aliases</span> = <span class="ruby-ivar">@aliases</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
    [<span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">comment</span>)]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">is_alias_for</span> = [
    <span class="ruby-ivar">@is_alias_for</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">full_name</span>,
    <span class="ruby-ivar">@is_alias_for</span>.<span class="ruby-identifier">singleton</span>,
    <span class="ruby-ivar">@is_alias_for</span>.<span class="ruby-identifier">name</span>
  ] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_alias_for</span>

  [ <span class="ruby-constant">MARSHAL_VERSION</span>,
    <span class="ruby-ivar">@name</span>,
    <span class="ruby-identifier">full_name</span>,
    <span class="ruby-ivar">@singleton</span>,
    <span class="ruby-ivar">@visibility</span>,
    <span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@comment</span>),
    <span class="ruby-ivar">@call_seq</span>,
    <span class="ruby-ivar">@block_params</span>,
    <span class="ruby-identifier">aliases</span>,
    <span class="ruby-ivar">@params</span>,
    <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">relative_name</span>,
    <span class="ruby-ivar">@calls_super</span>,
    <span class="ruby-ivar">@parent</span>.<span class="ruby-identifier">name</span>,
    <span class="ruby-ivar">@parent</span>.<span class="ruby-identifier">class</span>,
    <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">title</span>,
    <span class="ruby-identifier">is_alias_for</span>,
  ]
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Loads this <a href="AnyMethod.html">AnyMethod</a> from <code>array</code>. 
For a loaded <a href="AnyMethod.html">AnyMethod</a> the following methods
will return cached values:</p>
<ul><li>
<p><a href="MethodAttr.html#method-i-full_name">full_name</a></p>
</li><li>
<p><a href="MethodAttr.html#method-i-parent_name">parent_name</a></p>
</li></ul>
          
          

          
          <div class="method-source-code" id="marshal_load-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 166</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">marshal_load</span> <span class="ruby-identifier">array</span>
  <span class="ruby-identifier">initialize_visibility</span>

  <span class="ruby-ivar">@dont_rename_initialize</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@token_stream</span>           = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@aliases</span>                = []
  <span class="ruby-ivar">@parent</span>                 = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@parent_name</span>            = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@parent_class</span>           = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@section</span>                = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@file</span>                   = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">version</span>        = <span class="ruby-identifier">array</span>[<span class="ruby-value">0</span>]
  <span class="ruby-ivar">@name</span>          = <span class="ruby-identifier">array</span>[<span class="ruby-value">1</span>]
  <span class="ruby-ivar">@full_name</span>     = <span class="ruby-identifier">array</span>[<span class="ruby-value">2</span>]
  <span class="ruby-ivar">@singleton</span>     = <span class="ruby-identifier">array</span>[<span class="ruby-value">3</span>]
  <span class="ruby-ivar">@visibility</span>    = <span class="ruby-identifier">array</span>[<span class="ruby-value">4</span>]
  <span class="ruby-ivar">@comment</span>       = <span class="ruby-identifier">array</span>[<span class="ruby-value">5</span>]
  <span class="ruby-ivar">@call_seq</span>      = <span class="ruby-identifier">array</span>[<span class="ruby-value">6</span>]
  <span class="ruby-ivar">@block_params</span>  = <span class="ruby-identifier">array</span>[<span class="ruby-value">7</span>]
  <span class="ruby-comment">#                      8 handled below</span>
  <span class="ruby-ivar">@params</span>        = <span class="ruby-identifier">array</span>[<span class="ruby-value">9</span>]
  <span class="ruby-comment">#                      10 handled below</span>
  <span class="ruby-ivar">@calls_super</span>   = <span class="ruby-identifier">array</span>[<span class="ruby-value">11</span>]
  <span class="ruby-ivar">@parent_name</span>   = <span class="ruby-identifier">array</span>[<span class="ruby-value">12</span>]
  <span class="ruby-ivar">@parent_title</span>  = <span class="ruby-identifier">array</span>[<span class="ruby-value">13</span>]
  <span class="ruby-ivar">@section_title</span> = <span class="ruby-identifier">array</span>[<span class="ruby-value">14</span>]
  <span class="ruby-ivar">@is_alias_for</span>  = <span class="ruby-identifier">array</span>[<span class="ruby-value">15</span>]

  <span class="ruby-identifier">array</span>[<span class="ruby-value">8</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">new_name</span>, <span class="ruby-identifier">comment</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">add_alias</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Alias</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">nil</span>, <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">new_name</span>, <span class="ruby-identifier">comment</span>, <span class="ruby-ivar">@singleton</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@parent_name</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@full_name</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/#/</span> <span class="ruby-keyword">then</span>
                     <span class="ruby-node">$`</span>
                   <span class="ruby-keyword">else</span>
                     <span class="ruby-identifier">name</span> = <span class="ruby-ivar">@full_name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;::&#39;</span>)
                     <span class="ruby-identifier">name</span>.<span class="ruby-identifier">pop</span>
                     <span class="ruby-identifier">name</span>.<span class="ruby-identifier">join</span> <span class="ruby-string">&#39;::&#39;</span>
                   <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@file</span> = <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">TopLevel</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">array</span>[<span class="ruby-value">10</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Method name</p>

<p>If the method has no assigned name, it extracts it from <a
href="AnyMethod.html#attribute-i-call_seq">call_seq</a>.</p>
          
          

          
          <div class="method-source-code" id="name-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 215</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@name</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@name</span>

  <span class="ruby-ivar">@name</span> =
    <span class="ruby-ivar">@call_seq</span>[<span class="ruby-regexp">/^.*?\.(\w+)/</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">||</span>
    <span class="ruby-ivar">@call_seq</span>[<span class="ruby-regexp">/^.*?(\w+)/</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">||</span>
    <span class="ruby-ivar">@call_seq</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@call_seq</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>A list of this method&#39;s method and yield parameters. 
<code>call-seq</code> params are preferred over parsed method and block
params.</p>
          
          

          
          <div class="method-source-code" id="param_list-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 228</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">param_list</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@call_seq</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@call_seq</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">last</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/.*?\((.*)\)/</span>, <span class="ruby-string">&#39;\1&#39;</span>)
    <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/(\{|do)\s*\|([^|]*)\|.*/</span>, <span class="ruby-string">&#39;,\2&#39;</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@params</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@params</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/\((.*)\)/</span>, <span class="ruby-string">&#39;\1&#39;</span>)

    <span class="ruby-identifier">params</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;,#{@block_params}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@block_params</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@block_params</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@block_params</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">return</span> []
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@block_params</span> <span class="ruby-keyword">then</span>
    <span class="ruby-comment"># If this method has explicit block parameters, remove any explicit</span>
    <span class="ruby-comment"># &amp;block</span>
    <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/,?\s*&amp;\w+/</span>, <span class="ruby-string">&#39;&#39;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/\&amp;(\w+)/</span>, <span class="ruby-string">&#39;\1&#39;</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\s+/</span>, <span class="ruby-string">&#39;&#39;</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;,&#39;</span>).<span class="ruby-identifier">reject</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:empty?</span>)

  <span class="ruby-identifier">params</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span> <span class="ruby-identifier">param</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/=.*/</span>, <span class="ruby-string">&#39;&#39;</span>) }
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Pretty parameter list for this method.  If the method&#39;s parameters were
given by <code>call-seq</code> it is preferred over the parsed values.</p>
          
          

          
          <div class="method-source-code" id="param_seq-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 260</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">param_seq</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@call_seq</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@call_seq</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">last</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/[^( ]+/</span>, <span class="ruby-string">&#39;&#39;</span>)
    <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/</span>, <span class="ruby-string">&#39;\1 \2&#39;</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@params</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@params</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\s*\#.*/</span>, <span class="ruby-string">&#39;&#39;</span>)
    <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-string">&quot;\n&quot;</span>, <span class="ruby-string">&quot; &quot;</span>).<span class="ruby-identifier">squeeze</span>(<span class="ruby-string">&quot; &quot;</span>)
    <span class="ruby-identifier">params</span> = <span class="ruby-node">&quot;(#{params})&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?(</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@block_params</span> <span class="ruby-keyword">then</span>
    <span class="ruby-comment"># If this method has explicit block parameters, remove any explicit</span>
    <span class="ruby-comment"># &amp;block</span>
    <span class="ruby-identifier">params</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/,?\s*&amp;\w+/</span>, <span class="ruby-string">&#39;&#39;</span>)

    <span class="ruby-identifier">block</span> = <span class="ruby-ivar">@block_params</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\s*\#.*/</span>, <span class="ruby-string">&#39;&#39;</span>)
    <span class="ruby-identifier">block</span> = <span class="ruby-identifier">block</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-string">&quot;\n&quot;</span>, <span class="ruby-string">&quot; &quot;</span>).<span class="ruby-identifier">squeeze</span>(<span class="ruby-string">&quot; &quot;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?(</span>
      <span class="ruby-identifier">block</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/^\(/</span>, <span class="ruby-string">&#39;&#39;</span>).<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/\)/</span>, <span class="ruby-string">&#39;&#39;</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">params</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; { |#{block}| ... }&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">params</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>Sets the store for this method and its referenced code objects.</p>
          
          
            <div class="method-calls-super">
              Calls superclass method
              <a href="MethodAttr.html#method-i-store-3D">RDoc::MethodAttr#store=</a>
            </div>
          

          
          <div class="method-source-code" id="store-3D-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 292</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">store=</span> <span class="ruby-identifier">store</span>
  <span class="ruby-keyword">super</span>

  <span class="ruby-ivar">@file</span> = <span class="ruby-ivar">@store</span>.<span class="ruby-identifier">add_file</span> <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">full_name</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@file</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

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

        <div class="method-description">
          
          <p>For methods that <code>super</code>, find the superclass method that would
be called.</p>
          
          

          
          <div class="method-source-code" id="superclass_method-source">
            <pre><span class="ruby-comment"># File lib/rdoc/any_method.rb, line 301</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">superclass_method</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@calls_super</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@superclass_method</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@superclass_method</span>

  <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">each_ancestor</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ancestor</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">method</span> = <span class="ruby-identifier">ancestor</span>.<span class="ruby-identifier">method_list</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@name</span> } <span class="ruby-keyword">then</span>
      <span class="ruby-ivar">@superclass_method</span> = <span class="ruby-identifier">method</span>
      <span class="ruby-keyword">break</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@superclass_method</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

