What is the way to extend a module function? In the following, I want to use B.foo
module A
module_function
def foo; end
end
module B
extend A
end
B.foo
but it returns the error:
private method `foo' called for B:Module.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to use it directly you need to make it public as well.