Use with block

suggest change
class Animal
  def method_missing(method, *args, &block)
    if method.to_s == 'say'
      block.call
    else
      super
    end
  end
end

 => Animal.new.say{ 'moo' }
 => "moo"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents