title: ruby injecting methods as parameters
body: <p>So am trying to write functional ruby and for this purpose need to inject lambdas where ever required. But this is turning out to be not so elegant and useful. Example:</p>
  
  <pre><code>def this_is_a_test(arg1, fn_one = self.default_fn_one, fn_two = self.default_fn_two)
    #Something here
  end
  </code></pre>
  
  <p>There are two disadvantages about this:</p>
  
  <ol>
  <li>If I need to inject more methods, the arity becomes too big</li>
  <li>If I want to only inject <code>fn_two</code> and use default for <code>fn_one</code> its not possible</li>
  </ol>
  
  <p>So I tried this approach (picked up the idea from rails):</p>
  
  <pre><code>def this_is_a_test(arg1, options = {})
    opts = {
      fn_one: self.default_fn_one,
      fn_two: self.default_fn_two
    }.merge(options)
  
  #Something here
  
  end
  </code></pre>
  
  <p>This does take care of those two cases but I wanted to know if this is the best approach? Is there a way to do this without the options hash?</p>