From: Gavin Kistner Date: 2004-10-22T10:40:40+09:00 Subject: Re: CamelCase issues On Oct 21, 2004, at 3:17 PM, Michael DeHaan wrote: > To clean this up, I'd be apt to use attr_reader and attr_writer, while > overriding the render_content= function. I do this for some of my own libraries (because I want the method to be RDoc'd as an attribute, but need to do something custom when setting), but be forewarned that this will cause Ruby to throw a warning about redefining the foo= method: # The Dir instance or path to the directory to watch. attr_accessor :directory def directory=( dir ) #:nodoc: @directory = dir.is_a?(Dir) ? dir : Dir.new( dir ) end [Slim:~/Sites/_rubylibs] gavinkis% ruby DirectoryWatcher.rb [Slim:~/Sites/_rubylibs] gavinkis% ruby -w DirectoryWatcher.rb DirectoryWatcher.rb:98: warning: method redefined; discarding old directory=