From: Ross Bamford Date: 2005-12-07T00:47:35+09:00 Subject: Re: getting around access control On Tue, 06 Dec 2005 15:01:48 -0000, Gene Tani wrote: >> yeah - it's quite strange. unfortunately the 'send' approach won't work >> because the actual usage is something like >> > > Anyway, i think the 'send' of private methods is / will be changed in > 1.9 so you can't do it anymore. Don't know about the other access > control runaround, where you can subclass a class with private meths > and declare them public (p 393 of pickax), if that will/is changed in > 1.9 > Isn't access control kind of advisory anyway? Hopefully this isn't about to change??? irb(main):001:0> class Clz irb(main):002:1> def amethod irb(main):003:2> "amethod" irb(main):004:2> end irb(main):005:1> private :amethod irb(main):006:1> end => Clz irb(main):007:0> Clz.new.amethod NoMethodError: private method `amethod' called for # from (irb):7 irb(main):008:0> class Clz irb(main):009:1> public :amethod irb(main):010:1> end => Clz irb(main):011:0> Clz.new.amethod => "amethod" Or have I missed something ? -- Ross Bamford - rosco@roscopeco.remove.co.uk "\e[1;31mL"