In my config/initializers/refinery folder, there are some config files structured as
initializers
├── backtrace_silencers.rb
├── inflections.rb
├── mime_types.rb
├── refinery
│ ├── authentication.rb
│ ├── core.rb
│ ├── i18n.rb
│ ├── images.rb
│ ├── page_images.rb
│ ├── pages.rb
│ └── resources.rb
├── secret_token.rb
├── session_store.rb
└── wrap_parameters.rb
With refinery/ with rails console --sandbox, I get
Refinery.included_modules
#=> []
Why? When I press Tab after Refinery::P, it shows the following modules.
Refinery::Page Refinery::PagePart Refinery::PaginationHelper
Refinery::PageImages Refinery::Pages Refinery::Plugin
Refinery::PageImagesGenerator Refinery::PagesGenerator Refinery::Plugins
If it has ::, it must be somewhere and has to include it. Then why is include_modules working? Please correct me if I am wrong and show me the correct approach to display the modules or classes which are inside the modules. I referred http://www.ruby-doc.org/core-1.9.3/Module.html.
Those modules aren’t “included” in
Refinery, which is why they are not listed inincluded_modules.“Including” has a specific meaning in Ruby — basically, it’s when a class or module “mixes in” another module — whereas something like
Refinery::Pageis namespacing. Check out the Pragmatic Programmer’s Guide, which explains it well.Try
Refinery.constantsto get what you are after.