Module: IncludeAll
- Defined in:
- lib/include_all.rb
Overview
Implmentation of approach described by this SO article: stackoverflow.com/questions/3084325/getting-contents-classes-modules-of-required-files-in-ruby
Instance Method Summary collapse
Instance Method Details
#include_all(*args) ⇒ Object
6 7 8 9 |
# File 'lib/include_all.rb', line 6 def include_all(*args) added = list_objects() (added - $startup).each { |m| include m } end |
#list_objects ⇒ Object
11 12 13 |
# File 'lib/include_all.rb', line 11 def list_objects ObjectSpace.each_object(Module).to_a end |