From: Joel VanderWerf Date: 2005-06-04T05:10:57+09:00 Subject: Re: method_missing and assignment Patrick Gundlach wrote: > Hi, > > with ruby 1.8.2: > -------------------------------------------------- > class A > def method_missing (a,*b) > # do something > end > end > > > a=A.new > a.foo("bar","baz") > a.foo=("bar","baz") > -------------------------------------------------- > > the last line gives me an error > > -:11: syntax error > a.foo=("bar","baz") > ^ > > Any way I can assign multiple values in a natural way with > method_missing? Or would you suggest to use an array that holds > multiple data? > > Regards, > > Patrick It's not particularly a property of method_missing--you can't even define a method to do this: irb(main):001:0> def foo=(a,b); end => nil irb(main):002:0> self.foo=(1,2) SyntaxError: compile error (irb):2: syntax error self.foo=(1,2) ^ from (irb):2 irb(main):003:0>