Often we can use p foo or foo.inspect to view instance variables, but this is only the default behavior, and the object can choose to show something else (or hide all instance variables) (possibly by overriding the inspect method).
The main question: if I see foo.inspect that there is an @bar object that has an @bar instance variable that has the value "hello" , can I print @wah directly if there is no (reader) access for @bar and @wah ? Generally, it should not be readable if it does not have access, but what if for the purpose of debugging?
source share