From: 7stud -- Date: 2011-08-26T04:25:18+09:00 Subject: Re: New to Ruby some problems jack jones wrote in post #1018418: > First of all thank you very much 7stud :) > okay I got the method but I had a question how would Ruby know what's in > the [ ] and what's out of them > for example : > Well, you could play around with the method and find out. > class Dog > @array = [] > def []=(arg1, arg2, arg3) > array[arg1 + arg2] = arg3 # any operation > end > end > > > d = Dog.new > d.abc('hello') > d.[1,2]= 3 > # or > d.[1] = 2, 3 > # we have 3 args where to put each?? Are you sure you have 3 args? x = 10, 20, 30 p x --output:-- [10, 20, 30] How many 'things' were output for x? -- Posted via http://www.ruby-forum.com/.