title: Why do some methods accept only blocks as arguments in Ruby?
body: <p>Methods like <code>maps</code> and <code>collect</code> only accept blocks. If blocks are not objects and can't be saved to variables, then why do these methods need them as arguments?</p>
  
  <pre><code>multiples_of_2 = Proc.new do |x|
    x % 2 == 0
  end    
  sq = Proc.new { |x| x ** 2 }
  
  (1..50).to_a.select(&amp;multiples_of_2) # =&gt; works properly
  (1..50).to_a.select(multiples_of_2) # =&gt; `wrong number of arguments(1 for 0)`
  [4, 5, 6].map!(sq) # =&gt; `wrong number of arguments(1 for 0)`
  [10, 12, 14].collect!(sq) # =&gt; `wrong number of arguments(1 for 0)`
  </code></pre>