How to pass parameters to a proc when calling it by a method?
I think the best way is:
def thank name
yield name if block_given?
end
def thank(arg, &block)
yield arg
end
proc = Proc.new do|name|
puts "Thank you #{name}"
end
Then you can do:
thank("God", &proc)