Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
intuitive use case for unless...end statement in Ruby
require 'date'
def date_night?
Date.today.wday == 5 # friday
end
unless date_night?
puts "study hard!"
end
# shorthand also works...
puts "study hard!" unless date_night?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment