I can’t seem to find any documentation for for Ruby’s attr_accessor
method online? It is supposed to be in the Module class
(Class: Module (Ruby 1.9.3)).
I understand that the attr_* family of methods are private methods.
I found the private methods section for the Module class and the Object
class in the Pick Axe, but even there they are slightly hidden away
because in the Ruby Library Reference section (pg443 of 1.9 version)
private methods aren’t mentioned in the intro bit: “Standard classes are
listed alphabetically, followed by the standard modules. Within each, we
list the class (or module) methods, followed by its instance methods.”
But then it goes on to list private methods in the Module and Object
classes sections (only place private methods appear, I think?)
So where can I find attr_accessor in the official Ruby 1.9.3 online
docs?
And a few other related questions:
Is this a comprehensive list of the types of methods?
class
instance
private
protected
public (is public method the same as instance method?)
Are there any Ruby protected methods?
What’s the convention for writing a private method (a class method is
written e.g. Array::new, an instance method is written e.g. Array#pop)
Thx