Results 1 to 18 of 18
Dec 15, 2005, 07:01 #1
- Join Date
- Sep 2003
- Bratislava, Slovakia
- 0 Post(s)
- 0 Thread(s)
How to make attributes in Ruby private/inaccessible?
class Base def initialize @test = 123 end end class Child < Base def output print @test end public :output end child = Child.new child.output
If attribute "test" is private, why I am able to access it in Child class?
If attribute "test" is not private, what the hell am I missing?
How do I make it really private?
I really new to this Ruby stuff so please be polite.Annotations support for PHP5
TC/OPT™ Group Leader