Skip to content

Instantly share code, notes, and snippets.

@stormbrew
Created December 8, 2014 05:02
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 stormbrew/26f5d56728d9a75e66bf to your computer and use it in GitHub Desktop.
Save stormbrew/26f5d56728d9a75e66bf to your computer and use it in GitHub Desktop.
def surprising_case(*a)
case
when *a
true
else
false
end
end
surprising_case(false, false, false) # => false
surprising_case(false, true, false) # => true
surprising_case(false, true, true) # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment