Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Created February 12, 2013 17:48
Show Gist options
  • Save aalvesjr/4771690 to your computer and use it in GitHub Desktop.
Save aalvesjr/4771690 to your computer and use it in GitHub Desktop.
Testing Class#allocate
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