My question is similar to "What is the difference between include and extend in Ruby?".
What's the difference between require
and include
in Ruby? If I just want to use the methods from a module in my class, should I require
it or include
it?
Best Answer
Source
So if you just want to use a module, rather than extend it or do a mix-in, then you'll want to use
require
.Oddly enough, Ruby's
require
is analogous to C'sinclude
, while Ruby'sinclude
is almost nothing like C'sinclude
.