From: ahoward Date: 2003-01-12T05:43:29+09:00 Subject: Re: attr_reader/writer vs. attr_accessor w/ access control On Fri, 10 Jan 2003, Tom Sawyer wrote: [snip] > except for the fact that instance variables can spring into existence > dynamically, i wonder why they aren't simply attr_accessor by default and > access control the sole means by which we make them visible or invisible to > the outside. [snip] class AnArrayLikeClass def size @size end def size= n raise "THIS MAY NOT MAKE SENSE NO MATTER WHAT THE ACCESS CONTROL" end end i like the attr_accessor :var protected :var= alot though. -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================