title: **args as function parameter in Ruby
body: <p>I understand that <code>**args</code> is interpreted as a hash containing all key value pairs passed to a function but I don't understand why that would be preferred over a typical parameter. For example, I have the following two functions.</p>
  <pre><code>def test(some_string, hash)
      puts hash
      puts hash.class # =&gt; Hash
  end
  
  
  def test_two(some_string, **hash)
      puts hash
      puts hash.class # =&gt; Hash
  end 
  </code></pre>
  <p>calling <code>test(&quot;test string&quot;, a: 1, b: 2)</code> or <code>test_two(&quot;test string&quot;, a: 1, b: 2)</code> produces the exact same result. What is the benefit of using <code>**</code> as a parameter value?</p>