I am learning Ruby using codecademy and the current exercise tells the user to :
Define two methods in the editor:
A greeter
method that takes a single string parameter, name, and returns a string greeting that person. (Make sure to use return and don't use print or puts.)
A by_three?
method that takes a single integer parameter, number, and returns true if that number is evenly divisible by three and false if not. Remember, it's a Ruby best practice to end method names that produce boolean values with a question mark.
Based on that I came up with some code but it doesn't work and I do not know how to fix it or what I am missing. Any push in the right direction is greatly appreciated! Here is my code :
def greeter (name)
name = gets.chomp
return "Hi there #{name} sucka!"
end
def by_three(number)
number = gets.chomp
if number % 3 == 0
return true
else return false
end