Is there a way to do the include of a module with the require?
Sorry if this is obvious.
···
--
They are the flesh. They are the bone.
They are the very cornerstone.
Is there a way to do the include of a module with the require?
Sorry if this is obvious.
--
They are the flesh. They are the bone.
They are the very cornerstone.
The short answer is yes. Including a module is code like any other
code, and requiring a file runs the code in it. The longer answer
depends on information like what module you're trying to include into
what else, and how you're going to get that information (especially
the "what else" part).
To see this in action, note that many Rails plugins work by creating
modules and then, in the plugin's init.rb, including the module into
ActiveRecord::Base.
On Jun 16, 8:28 pm, Xeno Campanoli <xeno.campan...@gmail.com> wrote:
Is there a way to do the include of a module with the require?
Sorry if this is obvious.
--
-yossef