Created
July 8, 2011 19:48
-
-
Save bkempner/1072660 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_class(o) | |
case o.class | |
when Foo | |
puts "foo class" | |
else | |
puts "not found" | |
end | |
end | |
o = Foo.new | |
test_class(0) | |
#=> 'not found' | |
o.class == Foo | |
#=> 'true' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment