Ruby does provide private instance variables, constants, and private methods, but really, those are just suggestions.
For instance, if you override a constant, you just get a warning:
irb(main):001:0> A = 1If you have an object, and you want to call a private method, you can just inject a method into that object in order to get access to the private method:
irb(main):002:0> A = 2
(irb):2: warning: already initialized constant A
irb(main):003:0> puts A
class SuperSecretYou can use the same "inject a method" trick to get access to instance variables:
obj = SuperSecret.new
puts "Yep, it blocked me properly." # Yep, it gets blocked.
obj.hack_the_secret # Prints "Wombats!"
def obj.get_aIn no way am I criticizing Ruby for this behavior. As I said, I think it's a bad situation if you can't trust your team members. I just wanted to point out that in Ruby, the protection mechanisms are really just suggestions ;)