Class: StaticRails::DeterminesWhetherToHandleRequest
- Inherits:
-
Object
- Object
- StaticRails::DeterminesWhetherToHandleRequest
- Defined in:
- lib/static-rails/determines_whether_to_handle_request.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ DeterminesWhetherToHandleRequest
constructor
A new instance of DeterminesWhetherToHandleRequest.
Constructor Details
#initialize ⇒ DeterminesWhetherToHandleRequest
Returns a new instance of DeterminesWhetherToHandleRequest.
3 4 5 |
# File 'lib/static-rails/determines_whether_to_handle_request.rb', line 3 def initialize @matches_request_to_static_site = MatchesRequestToStaticSite.new end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/static-rails/determines_whether_to_handle_request.rb', line 7 def call(env) req = Rack::Request.new(env) (req.get? || req.head?) && (StaticRails.config.proxy_requests || StaticRails.config.serve_compiled_assets) && @matches_request_to_static_site.call(req) end |