I am new to Ruby and started to learn it a few months ago. And this is
my first post in this forum.
I was taugth that OOP is a good way to comply with encapsulation and
information hiding. Ruby is a OO programming language. So I can’t
understand why Ruby objects respond to methods like:
I was taugth that OOP is a good way to comply with encapsulation and
information hiding. Ruby is a OO programming language. So I can’t
understand why Ruby objects respond to methods like:
It allows you to do amazing things with meta programming etc. It does
not strictly prohibit access to internal state but kindly asks you to
not mess with it - unless you know exactly what you are doing.
Cheers
robert
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.