/Users/jwebb/src/bigjason/elster/doc/Elster/Streamer.html in elster-0.0.7 vs /Users/jwebb/src/bigjason/elster/doc/Elster/Streamer.html in elster-0.0.8
- old
+ new
@@ -98,17 +98,53 @@
</dl>
<div class="clear"></div>
+ <h2>Constant Summary</h2>
+
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
+ <ul class="summary">
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#output-instance_method" title="#output (instance method)">- (Object) <strong>output</strong> </a>
+
+
+ </span>
+
+
+
+
+ <span class="note title readonly">readonly</span>
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute output.</p>
+</div></span>
+
+</li>
+
+
+ </ul>
+
+
+
+
+
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
@@ -129,13 +165,11 @@
- <span class="summary_desc"><div class='inline'><p>
-Output an array.
-</p>
+ <span class="summary_desc"><div class='inline'><p>Output an array.</p>
</div></span>
</li>
@@ -154,13 +188,11 @@
- <span class="summary_desc"><div class='inline'><p>
-Close the encoding optionally closing the provided output stream.
-</p>
+ <span class="summary_desc"><div class='inline'><p>Close the encoding optionally closing the provided output stream.</p>
</div></span>
</li>
@@ -181,13 +213,11 @@
- <span class="summary_desc"><div class='inline'><p>
-Create a new instance of Streamer with the specified output stream.
-</p>
+ <span class="summary_desc"><div class='inline'><p>Create a new instance of Streamer with the specified output stream.</p>
</div></span>
</li>
@@ -206,13 +236,11 @@
- <span class="summary_desc"><div class='inline'><p>
-Output an object key value pair.
-</p>
+ <span class="summary_desc"><div class='inline'><p>Output an object key value pair.</p>
</div></span>
</li>
@@ -231,14 +259,12 @@
</h3><div class="docstring">
<div class="discussion">
- <p>
-Create a new instance of Streamer with the specified output stream. The
-`output` must respond to `write`.
-</p>
+ <p>Create a new instance of Streamer with the specified output stream. The
+<code>output</code> must respond to <code>write</code>.</p>
</div>
</div>
<div class="tags">
@@ -248,19 +274,19 @@
<tr>
<td>
<pre class="lines">
-8
9
10
11
12
-13</pre>
+13
+14</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 8</span>
+ <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 9</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span>
<span class='ivar'>@output</span> <span class='op'>=</span> <span class='id identifier rubyid_output'>output</span>
<span class='comment'># Some mutable state to make Rich Hickey weep.
</span> <span class='ivar'>@stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -271,11 +297,58 @@
</table>
</div>
</div>
+ <div id="instance_attr_details" class="attr_details">
+ <h2>Instance Attribute Details</h2>
+
+
+ <span id=""></span>
+ <div class="method_details first">
+ <h3 class="signature first" id="output-instance_method">
+
+ - (<tt>Object</tt>) <strong>output</strong> <span class="extras">(readonly)</span>
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+ <p>Returns the value of attribute output</p>
+
+
+ </div>
+</div>
+<div class="tags">
+
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+5
+6
+7</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 5</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_output'>output</span>
+ <span class='ivar'>@output</span>
+<span class='kw'>end</span></pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ </div>
+
+
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
@@ -287,29 +360,26 @@
</h3><div class="docstring">
<div class="discussion">
- <p>
-Output an array. If a block is passes the `value` will be ignored and a
-nested value started.
-</p>
-<p>
-Example:
-</p>
-<pre class="code ruby"><code>
- json.add(1)
- json.add("Ansible")
+ <p>Output an array. If a block is passes the <code>value</code> will be ignored and a nested value
+started.</p>
- [ 1, "Ansible" ]
+<p>Example:</p>
- json.add(1)
+<p>json.add(1)
+ json.add("Ansible")</p>
+
+<p>[ 1, "Ansible" ]</p>
+
+<p>json.add(1)
json.add do
json.set(:name, "Wiggens")
- end
+ end</p>
- [ 1, { "name" : "Wiggens" } ]</code></pre>
+<p>[ 1, { "name" : "Wiggens" } ]</p>
</div>
</div>
<div class="tags">
@@ -319,15 +389,10 @@
<tr>
<td>
<pre class="lines">
-83
-84
-85
-86
-87
88
89
90
91
92
@@ -336,16 +401,29 @@
95
96
97
98
99
-100</pre>
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 83</span>
+ <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 88</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
+ <span class='kw'>if</span> <span class='ivar'>@current_type</span> <span class='op'>==</span> <span class='symbol'>:object</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>JsonContainerTypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Attempted to add an array value inside a JSON object.</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
+
<span class='kw'>if</span> <span class='ivar'>@item_count</span> <span class='op'>></span> <span class='int'>0</span>
<span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span>
<span class='kw'>else</span>
<span class='ivar'>@current_type</span> <span class='op'>=</span> <span class='symbol'>:array</span>
<span class='id identifier rubyid_begin_section'>begin_section</span>
@@ -375,13 +453,11 @@
</h3><div class="docstring">
<div class="discussion">
- <p>
-Close the encoding optionally closing the provided output stream.
-</p>
+ <p>Close the encoding optionally closing the provided output stream.</p>
</div>
</div>
<div class="tags">
@@ -391,19 +467,19 @@
<tr>
<td>
<pre class="lines">
-16
17
18
19
20
-21</pre>
+21
+22</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 16</span>
+ <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 17</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span><span class='lparen'>(</span><span class='id identifier rubyid_close_stream'>close_stream</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
<span class='id identifier rubyid_end_section'>end_section</span>
<span class='kw'>if</span> <span class='id identifier rubyid_close_stream'>close_stream</span>
<span class='ivar'>@output</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
@@ -423,35 +499,32 @@
</h3><div class="docstring">
<div class="discussion">
- <p>
-Output an object key value pair. If a block is passed, the `value` will be
-ignored and a nested object or array can be added.
-</p>
-<p>
-Example:
-</p>
-<pre class="code ruby"><code>
- json.key(:mistake, "HUGE!")
+ <p>Output an object key value pair. If a block is passed, the <code>value</code> will be
+ignored and a nested object or array can be added.</p>
- { "mistake" : "HUGE!" }
+<p>Example:</p>
- json.key(:mistake) do
- json.key(:type, "HUGE!")
- end
+<p>json.key(:mistake, "HUGE!")</p>
- { "mistake" : { "type" : "HUGE!" } }
+<p>{ "mistake" : "HUGE!" }</p>
- json.key(:mistake) do
- json.add("HUGE!")
- end
+<p>json.key(:mistake) do
+ json.key(:type, "HUGE!")
+ end</p>
- { "mistake" : [ "HUGE!" ] }</code></pre>
+<p>{ "mistake" : { "type" : "HUGE!" } }</p>
+<p>json.key(:mistake) do
+ json.add("HUGE!")
+ end</p>
+<p>{ "mistake" : [ "HUGE!" ] }</p>
+
+
</div>
</div>
<div class="tags">
@@ -459,11 +532,10 @@
<tr>
<td>
<pre class="lines">
-45
46
47
48
49
50
@@ -479,16 +551,25 @@
60
61
62
63
64
-65</pre>
+65
+66
+67
+68
+69
+70</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 45</span>
+ <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 46</span>
<span class='kw'>def</span> <span class='id identifier rubyid_key'>key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
+ <span class='kw'>if</span> <span class='ivar'>@current_type</span> <span class='op'>==</span> <span class='symbol'>:array</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>JsonContainerTypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Attempted to write an object `key` value inside a JSON array.</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
+
<span class='kw'>if</span> <span class='ivar'>@item_count</span> <span class='op'>></span> <span class='int'>0</span>
<span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span>
<span class='kw'>else</span>
<span class='ivar'>@current_type</span> <span class='op'>=</span> <span class='symbol'>:object</span>
<span class='id identifier rubyid_begin_section'>begin_section</span>
@@ -515,12 +596,12 @@
</div>
</div>
<div id="footer">
- Generated on Sun Aug 19 23:07:22 2012 by
+ Generated on Tue Aug 21 21:31:10 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.8.2.1 (ruby-1.9.2).
+ 0.8.2.1 (ruby-1.9.3).
</div>
</body>
</html>
\ No newline at end of file