class ActionDispatch::Routing::StaticResponder

Attributes

path[RW]

Public Class Methods

new(path) click to toggle source
# File lib/action_dispatch/routing/static_responder.rb, line 85
def initialize(path)
  self.path = path
  self.trigger_file_handler_initialization
end

Public Instance Methods

call(env) click to toggle source
# File lib/action_dispatch/routing/static_responder.rb, line 95
def call(env)
  env["PATH_INFO"] = @file_handler.match?(path)
  @file_handler.call(env)
end
file_handler() click to toggle source
# File lib/action_dispatch/routing/static_responder.rb, line 63
def file_handler
  @file_handler ||= ::ActionDispatch::FileHandler.new(
    Rails.configuration.paths["public"].first,
    Rails.configuration.static_cache_control
  )
end
inspect() click to toggle source
# File lib/action_dispatch/routing/static_responder.rb, line 105
def inspect
  "static('#{path}')"
end
trigger_file_handler_initialization() click to toggle source
# File lib/action_dispatch/routing/static_responder.rb, line 90
def trigger_file_handler_initialization
  file_handler
end