From: Brian Candler Date: 2010-08-26T23:39:05+09:00 Subject: Re: #attr back to 1.8.6 an older behavior? Thomas Sawyer wrote: > What happened to dropping the optional true/false parameter from #attr > in 1.9? About a year or so ago, the method was changed to support > multiple symbols, and if you wanted a writer you just add one with an > '=' on the end, e.g. > > attr :x, :x= FWIW, it looks like 1.9.1 doesn't allow attr :x= anyway (reader attributes only) irb(main):001:0> class Foo irb(main):002:1> attr :x, :x= irb(main):003:1> end NameError: invalid attribute name `x=' from (irb):2:in `attr' from (irb):2:in `' from (irb):1 from /usr/local/bin/irb191:12:in `
' irb(main):004:0> RUBY_DESCRIPTION => "ruby 1.9.1p429 (2010-07-02 revision 28523) [x86_64-linux]" -- Posted via http://www.ruby-forum.com/.