testing encapsulation in ruby