Skip to content

Instantly share code, notes, and snippets.

@davejlong
Last active April 12, 2016 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davejlong/b1d6b20d0d176c8efacb60f630aa8214 to your computer and use it in GitHub Desktop.
Save davejlong/b1d6b20d0d176c8efacb60f630aa8214 to your computer and use it in GitHub Desktop.
case
when options.key?("car")
# Validate car
when options.key?("driver")
# Validate driver
else
# If no other statement matches, error out
end
if options.key?("car") || options.key?("driver")
validate_car(options["car"]) if options.key?("car")
validate_driver(options["driver"]) if options.key?("driver")
else
raise StandardError, "..."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment