doc/Elephas/Backends/Hash.html in elephas-3.0.1 vs doc/Elephas/Backends/Hash.html in elephas-4.0.0

- old
+ new

@@ -4,17 +4,17 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Class: Elephas::Backends::Hash - &mdash; Documentation by YARD 0.8.5.2 + &mdash; Documentation by YARD 0.8.6.1 </title> - <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" /> + <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" /> - <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" /> + <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> hasFrames = window.top.frames.main ? true : false; relpath = '../../'; framesUrl = "../../frames.html#!" + escape(window.location.href); @@ -119,11 +119,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#data-instance_method" title="#data (instance method)">- (Hash) <strong>data</strong> </a> + <a href="#data-instance_method" title="#data (instance method)">- (HashWithIndifferentAccess) <strong>data</strong> </a> </span> @@ -344,11 +344,11 @@ </td> <td> <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 19</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> - <span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> + <span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -361,11 +361,11 @@ <span id="data=-instance_method"></span> <div class="method_details first"> <h3 class="signature first" id="data-instance_method"> - - (<tt><span class='object_link'><a href="" title="Elephas::Backends::Hash (class)">Hash</a></span></tt>) <strong>data</strong> + - (<tt>HashWithIndifferentAccess</tt>) <strong>data</strong> @@ -382,11 +382,11 @@ <ul class="return"> <li> - <span class='type'>(<tt><span class='object_link'><a href="" title="Elephas::Backends::Hash (class)">Hash</a></span></tt>)</span> + <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span> &mdash; <div class='inline'><p>The internal hash used by the backend.</p> @@ -449,13 +449,11 @@ 57 58 59 60 61 -62 -63 -64</pre> +62</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 13</span> <span class='kw'>class</span> <span class='const'>Hash</span> <span class='op'>&lt;</span> <span class='const'>Base</span> @@ -463,19 +461,19 @@ <span class='comment'># Initialize the backend. </span> <span class='comment'># </span> <span class='comment'># @param data [Hash] The initial data stored. </span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> - <span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> + <span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span> <span class='kw'>end</span> <span class='comment'># Reads a value from the cache. </span> <span class='comment'># </span> <span class='comment'># @param key [String] The key to lookup. </span> <span class='comment'># @return [Entry|NilClass] The read value or `nil`. </span> <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='kw'>nil</span> + <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='kw'>nil</span> <span class='kw'>end</span> <span class='comment'># Writes a value to the cache. </span> <span class='comment'># </span> <span class='comment'># @param key [String] The key to associate the value with. @@ -484,31 +482,29 @@ </span> <span class='comment'># @see Elephas::Cache.setup_options </span> <span class='comment'># @return [Object] The value itself. </span> <span class='kw'>def</span> <span class='id identifier rubyid_write'>write</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='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Elephas</span><span class='op'>::</span><span class='const'>Entry</span><span class='period'>.</span><span class='id identifier rubyid_ensure'>ensure</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_refresh'>refresh</span> - <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_entry'>entry</span> + <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_entry'>entry</span> <span class='id identifier rubyid_entry'>entry</span> <span class='kw'>end</span> <span class='comment'># Deletes a value from the cache. </span> <span class='comment'># </span> <span class='comment'># @param key [String] The key to delete. </span> <span class='comment'># @return [Boolean] `true` if the key was in the cache, `false` otherwise. </span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='id identifier rubyid_rv'>rv</span> <span class='kw'>end</span> <span class='comment'># Checks if a key exists in the cache. </span> <span class='comment'># </span> <span class='comment'># @param key [String] The key to lookup. </span> <span class='comment'># @return [Boolean] `true` if the key is in the cache, `false` otherwise. </span> <span class='kw'>def</span> <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> @@ -585,18 +581,16 @@ 49 50 51 52 -53 -54</pre> +53</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 49</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='id identifier rubyid_rv'>rv</span> <span class='kw'>end</span></pre> </td> @@ -663,20 +657,18 @@ <tr> <td> <pre class="lines"> +59 60 -61 -62 -63</pre> +61</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 60</span> + <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 59</span> <span class='kw'>def</span> <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -749,11 +741,11 @@ </td> <td> <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 27</span> <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='kw'>nil</span> + <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='kw'>nil</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -869,11 +861,11 @@ <pre class="code"><span class="info file"># File 'lib/elephas/backends/hash.rb', line 38</span> <span class='kw'>def</span> <span class='id identifier rubyid_write'>write</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='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Elephas</span><span class='op'>::</span><span class='const'>Entry</span><span class='period'>.</span><span class='id identifier rubyid_ensure'>ensure</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_refresh'>refresh</span> - <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_entry'>entry</span> + <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_entry'>entry</span> <span class='id identifier rubyid_entry'>entry</span> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -882,12 +874,12 @@ </div> </div> <div id="footer"> - Generated on Sat Apr 13 12:09:04 2013 by + Generated on Sun May 19 15:44:47 2013 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.8.5.2 (ruby-1.9.3). + 0.8.6.1 (ruby-1.9.3). </div> </body> </html> \ No newline at end of file