Sha256: a759cd372b9c657894f7891927ea4060a38fe2f46fa5f154403e288786bf794e

Contents?: true

Size: 1.94 KB

Versions: 3

Compression:

Stored size: 1.94 KB

Contents

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>[]= (Hash)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/facet/hash/%5B%5D%3D.rb, line 14</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
    <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">2</span>
      <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
    <span class="ruby-keyword kw">end</span>
    <span class="ruby-identifier">aVals</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span>
    <span class="ruby-identifier">aVals</span> = [<span class="ruby-identifier">aVals</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aVals</span>.<span class="ruby-identifier">kind_of?</span>( <span class="ruby-constant">Array</span> )
    <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each_index</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">store</span>( <span class="ruby-identifier">args</span>[<span class="ruby-identifier">i</span>], <span class="ruby-identifier">aVals</span>[<span class="ruby-identifier">i</span>] ) }
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-0.7.0 doc/atomic-rdoc/classes/Hash.src/M000086.html
facets-0.7.1 doc/atomic-rdoc/classes/Hash.src/M000086.html
facets-0.7.2 doc/atomic-rdoc/classes/Hash.src/M000087.html