Hi all,

I add a private method to class Object and try to call it from outside
the class. I am confused that it works. Any comments?

Thanks,

Li
##
class Object
 private
 def method1(arg1)
   arg1
 end
end

 puts "call private method"
 puts method1(1)

##
>ruby variables3.rb
call private method
1
>Exit code: 0

-- 
Posted via http://www.ruby-forum.com/.