Ruby Ruby Basics Ruby Syntax Defining Methods

Olvin Chambers
Olvin Chambers
899 Points

Define a method named say_hi.

Define a method named say_hi. The method body should include a call to puts with an argument of "hi". Then call your new say_hi method.

hello.rb
def say (hi)
    puts say_hi
end

say("say_hi")

1 Answer

Matthew Long
Matthew Long
28,350 Points

While you defined a method you didn't define the one the challenge was after. The challenge want's a method named "say_hi" instead of "say". The method then want's you to call puts with the string "hi".

def say_hi
  puts "hi"
end

say_hi

Happy holidays! :smile:

Olvin Chambers
Olvin Chambers
899 Points

Thanks. Appreciate it.

Happy Holidays to you !!!