Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.ruby Subject: Re: what's object_id in irb? Date: Tue, 05 Mar 2013 22:35:03 +0100 Lines: 30 Message-ID: References: <2c64d5aa-e5a3-4db4-b442-daeace8cb263@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 4mAKQLC3KEMPjAb0QAUxHQ4zy5xxOYJXUFqQzfrPjzdpXmC+fqNsIPbzU4+n5RK4E= Cancel-Lock: sha1:GouThYs13cDLDP35bguO4nlKl5g= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: <2c64d5aa-e5a3-4db4-b442-daeace8cb263@googlegroups.com> X-Antivirus: avast! (VPS 130305-0, 05.03.2013), Outbound message X-Antivirus-Status: Clean Xref: csiph.com comp.lang.ruby:6762 On 05.03.2013 17:30, Massimo Donati wrote: > Hi everyone i'm running this lines of code: > > [home/] irb > 2.0.0p0 :001 > object_id > => 70156571578960 > > > I can't really understand what is this object_id referred to since is not called from any object? It is: irb(main):001:0> object_id => -1073529238 irb(main):002:0> self => main irb(main):003:0> self.object_id => -1073529238 Note: self - as any variable - _always_ (no exception!) references an instance. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/