From: Abhijit Gadgil Date: 2007-04-24T21:35:23+09:00 Subject: Re: +@ and -@ methods ? Hi, On 4/24/07, gaurav bagga wrote:> Sorry I forgot to mention> when I do 1.methods.sort ,Is it something to do with unary operations? 1 is an object of type Integer 1.methods is a method in the Object Integer (which outputs an Array ofmethods for the integer) and .sort is a method on an Object of TypeArray (which sorts the contents of the Array) > On 4/24/07, gaurav.v.bagga@gmail.com wrote:> >> > Hi all,> >> > Mostly when I do instance.methods.sort in irb, the list contains +@> > and -@ what are these methods and how used.> > I'll appreciate if someone helps me with this. From the pickaxe book +@ is a unary + operator simply returns thereceivers value and -@ returns the negated value for Numeric Objects(floats / Integers) > --> Cheers> Gaurav> http://java-n-coffee.blogspot.com> http://rorwebser.blogspot.com> http://eclipsetrip.blogspot.com> -- अभिजीत [written in http://www.paahijen.com/scratchpad] [http://www.paahijen.com]