From: Gary Weaver Date: 2012-09-26T03:58:02+09:00 Subject: Re: could initialize return an existing object instead of a new instance? 7stud -- wrote in post #1077511: >> Is it possible for initialize to return an existing object instead >> of a new instance? > > > class Dog > def initialize > return 'hello' > end > end > > d = Dog.new > p d > > --output:-- > # class Dog > BARK = 'bark' > def self.new(arg=nil) > return BARK > end > end => nil > Dog.new.object_id => 2046 > Dog.new.object_id => 2046 nice! -- Posted via http://www.ruby-forum.com/.