F
Fritz Trapper
Is it possible to declare parts of a module as private or protected to
import these properties via mixin into classes?
import these properties via mixin into classes?
as a matter of fact it is,Is it possible to declare parts of a module as private or protected to
import these properties via mixin into classes?
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]
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.