Skip to content

Instantly share code, notes, and snippets.

@jredville
Created April 23, 2013 19:27
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 jredville/5446618 to your computer and use it in GitHub Desktop.
Save jredville/5446618 to your computer and use it in GitHub Desktop.
Example that Ruby case statements use `===` for comparison
puts /^(true|false)$/ === "true" #=> puts true
class Regexp
def ===(o)
false
end
end
case "true"
when /^(true|false)$/
puts 'boolean'
else
puts 'not boolean'
end #=> puts not boolean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment