i’m using rails 4.2.4. how define helper (private) method within module? have module
module webpagehelper def get_url(url) content = get_content(url) .. end def get_content(url) … end module_function :get_url end
i don’t want method “get_content” publicly accessible, above code error
error during processing: undefined method `get_content' webpagehelper:module
how define private helper method in module?
i think best way (and how existing libs written) making class within module deals logic, , module provides convenient method.
docs here;
or see here nice examples e.g. class << self
option.
Comments
Post a Comment