From: Robert Dober Date: 2010-08-23T07:03:14+09:00 Subject: Re: Module and protected/private functions On Sun, Aug 22, 2010 at 2:35 PM, Fritz Trapper wrote: > Is it possible to declare parts of a module as private or protected to > import these properties via mixin into classes? > -- > Posted via http://www.ruby-forum.com/. > > as a matter of fact it is, >> module M >> def a; end >> protected >> def aa; end >> private >> def aaa; end >> end => nil >> include M => Object >> private_methods.grep /\Aa/ => [:aaa, :at_exit, :abort, :autoload, :autoload?] >> protected_methods.grep /\Aa/ => [:aa] >> methods.grep /\Aa/ => [:a, :aa] >> HTH Robert -- The best way to predict the future is to invent it. -- Alan Kay