Created
March 11, 2014 20:05
-
-
Save matthijsgroen/9493897 to your computer and use it in GitHub Desktop.
Syntax definitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME = 'Programmer' | |
def say_hello(to) | |
raise StandardError.new('Noone to say hello to!') unless to | |
is_noon = Date.noon? | |
# We are missing some cases like | |
# good night, but this is enough value | |
# for now | |
if is_noon | |
puts "Good afternoon #{to}!" | |
else | |
puts "Good morning #{to}!" | |
end | |
true | |
end | |
say_hello NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment