1 2 3 4 5 6 7 8 9 10 11 12 13
class Parent private def method p true end public def call_method(p) p.method end end Parent.new.call_method(Parent.new)
1 2
Line 9:in `call_method': private method `method' called for #<Parent:0x401bf93c> (NoMethodError) from t.rb:13