I am learning how to use Module.prependinstead alias_method_chainin my Ruby code, and I noticed that some people use sendto call it ( example ):
ActionView::TemplateRenderer.send(:prepend,
ActionViewTemplateRendererWithCurrentTemplate)
Others call it directly ( example ):
ActionView::TemplateRenderer.prepend(ActionViewTemplateRendererWithCurrentTemplate)
And, although I have not seen anyone use this style, I suspect that from the documentation you can even write this in the module from which you added:
module ActionViewTemplateRendererWithCurrentTemplate
prepend_features ActionView::TemplateRenderer
end
Is there a difference between these three styles? Is there any reason to approve one of the others?
source
share