title: Passing a hash to a function ( *args ) and its meaning
body: <p>When using an idiom such as:</p>
  
  <pre><code>def func(*args)
    # some code
  end
  </code></pre>
  
  <p>What is the meaning of <code>*args</code>? Googling this specific question was pretty hard, and I couldn't find anything.</p>
  
  <p>It seems all the arguments actually appear in <code>args[0]</code> so I find myself writing defensive code such as:</p>
  
  <pre><code>my_var = args[0].delete(:var_name) if args[0]
  </code></pre>
  
  <p>But I'm sure there's a better way I'm missing out on.</p>