Skip to content

Instantly share code, notes, and snippets.

@softwaregravy
Created September 11, 2011 22:15
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 softwaregravy/1210203 to your computer and use it in GitHub Desktop.
Save softwaregravy/1210203 to your computer and use it in GitHub Desktop.
# What I really wanted my logic to be
def my_method(options = {})
if options.has_key?(:key) && !options[:key].nil?
if options[:key]
# do something using the option here
else
# do something else
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment