Skip to content

Instantly share code, notes, and snippets.

@paneq
Created December 18, 2012 17:59
Show Gist options
  • Save paneq/4330380 to your computer and use it in GitHub Desktop.
Save paneq/4330380 to your computer and use it in GitHub Desktop.
use === , not kind_of?
Boolean = Class.new do
def ===(comp)
comp == true || comp == false
end
end.new
Boolean === 1 #=> false
Boolean === "txt" #=> false
Boolean === true #=> true
Boolean === false #=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment