Created
February 12, 2013 17:48
-
-
Save aalvesjr/4771690 to your computer and use it in GitHub Desktop.
Testing Class#allocate
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
class Hello | |
def initialize | |
puts "New object instance of Hello class" | |
end | |
end | |
a = Hello.new | |
# => New object instance of Hello class | |
# => #<Hello:0x2368470> | |
b = Hello.allocate | |
# => #<Hello:0x232e5a0> | |
a.class | |
# => Hello | |
b.class | |
# => Hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment