4 ms·
You can call a proc with [] p = Proc.new {|str| puts "Hello #{str}" } p["World"] # prints "Hello World" :)
by epochwolf 16y ago
You can call a proc with []
p = Proc.new {|str| puts "Hello #{str}" }
p["World"] # prints "Hello World"
:)
- mcantor 16y agoI'm aware of this, but it's still not (). You still must be aware that you are dealing with an unbound proc object, and it must be handled differently than usual!