10. Call Me Maybe


#1

this is my code

      hi = Proc.new {"Hello!"}
      hi.call

it puts "Hello!" but it doesn't let me pass.
it says Oops, try again. It looks like your proc doesn't puts 'Hello!' when called.


#2

That's probably because you're returning "Hello!", not printing it. What are the instructions of the exercise?


#4

try using 'do' and 'puts' instead of the curly brackets, as in the previous exercise.

or you could fix your original code by just adding one word.


#5

it should be

Proc.new {puts "Hello!"}


#6

hi = Proc.new { puts "Hello!" }
hi.call

^works!


#7

Here is my code that worked:
hi = Proc.new do
puts"Hello!"
end
hi.call


#8

hi = Proc.new { puts "Hello!" }
hi.call


#9

hi=proc
proc=Proc.new { puts "Hello!"}
proc.call