On Sat, 10 Dec 2005 00:36:34 +0900, James Britt wrote:
> Mark J.Reed wrote:
>> This line:
>> 
>>         attr_accessor :foo
>> 
>> has identical results to this code:
>> 
>>         def foo
>>             @foo
>>         end
>> 
>>         def foo=(new_foo)
>>             @foo = new_foo
>>         end
>> 
> 
> Almost.  The rdoc output is different.  Using attr_accessor, rdoc does 
> not document 'foo' as being a method, but as being an attribute.
> 
> Unless you both  use attr_accessor *and* define method bodies.  Then 
> rdoc does both; foo is documented as both an attribute and a method.
> 
> James

Yup, that's what I mean. I found I could do that, but I didn't notice
it had documented them twice (just tried it and of course you're right),
but I did see that Ruby warns me that the previous definition was
discarded. It's not really a problem, but I do like to strive to be
warning-free :P

Cheers,
Ross

-- 
Ross Bamford - rosco / roscopeco.remove.co.uk
"\e[1;31mL"