doc/Caricature/MethodCallRecorder.html in caricature-0.5.0 vs doc/Caricature/MethodCallRecorder.html in caricature-0.6.0
- old
+ new
@@ -57,20 +57,18 @@
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
- <li><a href="#M000069">::new</a></li>
+ <li><a href="#M000078">::new</a></li>
- <li><a href="#M000072">#[]</a></li>
+ <li><a href="#M000080">#record_call</a></li>
- <li><a href="#M000070">#record_call</a></li>
+ <li><a href="#M000083">#size</a></li>
- <li><a href="#M000074">#size</a></li>
+ <li><a href="#M000082">#was_called?</a></li>
- <li><a href="#M000071">#was_called?</a></li>
-
</ul>
</div>
<!-- Included Modules -->
@@ -227,11 +225,11 @@
<div id="public-class-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="new-method" class="method-detail ">
- <a name="M000069"></a>
+ <a name="M000078"></a>
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">()</span>
@@ -250,13 +248,13 @@
<div class="method-source-code"
id="new-source">
<pre>
-<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 94</span>
+<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 95</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
- <span class="ruby-ivar">@method_calls</span> = {}
+ <span class="ruby-ivar">@method_calls</span> = {<span class="ruby-identifier">:instance</span> =<span class="ruby-operator">></span> {}, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">></span> {} }
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
@@ -268,51 +266,17 @@
<div id="public-instance-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
- <div id="--method" class="method-detail ">
- <a name="M000072"></a>
-
- <div class="method-heading">
-
- <span class="method-name">[]</span><span
- class="method-args">(method_name)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-indexer that gives you access to the recorded method by method name
-</p>
-
-
-
- <div class="method-source-code"
- id="--source">
-<pre>
-<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 118</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">method_name</span>)
- <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>]
- <span class="ruby-keyword kw">end</span></pre>
- </div>
-
- </div>
-
-
- </div>
-
-
<div id="record-call-method" class="method-detail ">
- <a name="M000070"></a>
+ <a name="M000080"></a>
<div class="method-heading">
<span class="method-name">record_call</span><span
- class="method-args">(method_name, *args, &block)</span>
+ class="method-args">(method_name, mode=:instance, *args, &block)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
@@ -325,15 +289,15 @@
<div class="method-source-code"
id="record-call-source">
<pre>
-<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 99</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_call</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
+<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 100</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_call</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:instance</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-identifier">mn_sym</span> = <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>
- <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mn_sym</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">MethodCallRecording</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">method_name</span>
- <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mn_sym</span>]
+ <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mode</span>][<span class="ruby-identifier">mn_sym</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">MethodCallRecording</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">method_name</span>
+ <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mode</span>][<span class="ruby-identifier">mn_sym</span>]
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">add_argument_variation</span> <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
@@ -342,11 +306,11 @@
</div>
<div id="size-method" class="method-detail ">
- <a name="M000074"></a>
+ <a name="M000083"></a>
<div class="method-heading">
<span class="method-name">size</span><span
class="method-args">()</span>
@@ -363,11 +327,11 @@
<div class="method-source-code"
id="size-source">
<pre>
-<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 123</span>
+<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 124</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size</span>
<span class="ruby-ivar">@method_calls</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
@@ -376,16 +340,16 @@
</div>
<div id="was-called--method" class="method-detail ">
- <a name="M000071"></a>
+ <a name="M000082"></a>
<div class="method-heading">
<span class="method-name">was_called?</span><span
- class="method-args">(method_name, *args)</span>
+ class="method-args">(method_name, mode=:instance, *args)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
@@ -398,12 +362,12 @@
<div class="method-source-code"
id="was-called--source">
<pre>
-<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 108</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">was_called?</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
- <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>]
+<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 109</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">was_called?</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:instance</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+ <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mode</span>][<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>]
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mc</span>
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">find_argument_variations</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">args</span>
<span class="ruby-keyword kw">else</span>
<span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">mc</span>
<span class="ruby-keyword kw">end</span>