title: How do i return a block of code in ruby
body: <p>I want to return a multi-line block of code from one function to be executed by another function</p>
  
  <p>for example</p>
  
  <pre><code>def foo 
    return #block
  end
  
  def bar(&amp;block)
    block.call
  end
  
  bar(foo)
  </code></pre>
  
  <p>Does any one know how to do this?
  Ruby 1.9.3</p>