aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
blob: 6139e20e95fdad074d164be3748f68d19ffb921c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module Rails
  class Application

    def self.config
      @config ||= Configuration.new
    end

    def self.config=(config)
      @config = config
    end

    def config
      self.class.config
    end

    def routes
      ActionController::Routing::Routes
    end

    def middleware
      config.middleware
    end

    def call(env)
      @app ||= middleware.build(routes)
      @app.call(env)
    end
  end
end