What does ruby include when it encounters the "include module" statement?
- by Steve Weet
If I have the following project structure
project/
lib/
subproject/
a.rb
b.rb
lib.rb
where lib.rb looks like this :-
module subproject
def foo
do_some_stuff
end
end
and a.rb and b.rb both need to mixin some methods within lib.rb and are both namespaced within a module like so :-
require 'subproject/lib'
…