H
Hadmut Danisch
Hi,
two questions or proposals about class attributes:
- If the access methods for a class variable are defined with
attr_accessor, rdoc shows them as [RW] in the attributes list.
But when the access method is explicitely defined with def,
then rdoc does not show it as attribute access, but as an
instance function.
Sometimes it would be nice to explicitely write the
attr= or attr methods (e.g. to do some checks or give default
values), but to have it listed in the documentation as a
plain attribute.
Is there a way to make rdoc recognize methods as attribute
methods?
If not, I'd propose a #:attr: flag.
- Is it possible to make attr_writer and attr_accessor notify
Observers if the value changes? If not, I'd propose to
define versions that do so.
If I do understand ruby correctly, then this would mean to
add new functions like oattr_writer to the Module class.
Hadmut
two questions or proposals about class attributes:
- If the access methods for a class variable are defined with
attr_accessor, rdoc shows them as [RW] in the attributes list.
But when the access method is explicitely defined with def,
then rdoc does not show it as attribute access, but as an
instance function.
Sometimes it would be nice to explicitely write the
attr= or attr methods (e.g. to do some checks or give default
values), but to have it listed in the documentation as a
plain attribute.
Is there a way to make rdoc recognize methods as attribute
methods?
If not, I'd propose a #:attr: flag.
- Is it possible to make attr_writer and attr_accessor notify
Observers if the value changes? If not, I'd propose to
define versions that do so.
If I do understand ruby correctly, then this would mean to
add new functions like oattr_writer to the Module class.
Hadmut