It really is a little hidden :)
RailsApp::Application is a child of the Rails::Application class, which in turn is the Rails::Engine , which is the Rails::Railtie . Now Rails::Railtie has an inherited hook that is called whenever the child class inherits the Railtie class (in this case, Engine ).
This callback includes the Rails::Railtie::Configurable module in a subclass. In this module you will find the first part of magic.
The method_missing method, which is defined in the class, calls the method in the class instance, which more or less allows
RailsApp::Application.new.call(...)
This call instance method is defined in Rails::Application#call and performs a typical rack transfer.
There is probably still a bit more magic, which makes it not the equivalent of 100%, but it should be something like this ...
Holger just
source share