|
|
|
|
|
by muchabi
4323 days ago
|
|
To add another example to the list, Ruby lets you list which attributes can be read/written and which ones can only be read on top. Something like. class Car
attr_reader :model, :company # only read
attr_accessor :color # read and write
end
|
|
This is pretty trivial so bear with me... If you have something that looks like this...
You can then do this... You will have then altered the value of @children without completely reassigning it.