Skip to content

Instantly share code, notes, and snippets.

@matthijsgroen
Created March 11, 2014 20:05
Show Gist options
  • Save matthijsgroen/9493897 to your computer and use it in GitHub Desktop.
Save matthijsgroen/9493897 to your computer and use it in GitHub Desktop.
Syntax definitions
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