Having trouble passing a proc to my function



Hello everyone :slight_smile: ,

I'm having some trouble figuring out how to pass a proc to my function .

(Error message: "Oops, try again.
It looks like you didn't print anything to the console. Did you call your greeter method and pass it the phrase proc?")

Anyone know where I messed up ?

Replace this line with your code. 
def greeter

phrase = Proc.new do |greeter|
    puts "Hello there!"

Thanks in advance,


a proc is another block of method
u had to pass the method, greeter into it in another step
because the way you doing it, you cannot pass other argument to the proc and hence it defeats the purpose of being a proc


Managed to fix my code using your advice. Thanks a lot my friend


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.