Skip to content

Instantly share code, notes, and snippets.

@bkempner
Created July 8, 2011 19:48
Show Gist options
  • Save bkempner/1072660 to your computer and use it in GitHub Desktop.
Save bkempner/1072660 to your computer and use it in GitHub Desktop.
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