On 6/16/07, Banzai <noemail / yahoo.com> wrote:
> ...
> d = Door.new("/path/to/door", "func")
> Is it more convenient to say:
>         d = Door.new(:path => "/path/to/door", :proc => "func")

From my experience the most Ruby-like way of doing this would be
   d = Door.new("/path/to/door") { |arg| arg ** 2 }

You can implement it like this

  class Door
    def initialize(path, &block)
      # var named block is now a Proc object
      @block = block
    end
  end

Regards,
- Erwin