4 ms·
Admittedly I have barely used Ruby, but isn't the fact that those "attr_reader"s have to be declared explicitly an indication that the fields are private by def
by frou_dh 9y ago
Admittedly I have barely used Ruby, but isn't the fact that those "attr_reader"s have to be declared explicitly an indication that the fields are private by default?
- simplify 9y agoattr_reader :my_prop is just a shorthand way of creating a convenience method that returns the internal value of @my_prop. But in any case, there is always a way to access a Ruby object's internal instance values. See my other comment in this thread.