class ActionController::Metal

def self.action(name)

Returns a Rack endpoint for the given action name.
def self.action(name)
  if middleware_stack.any?
    middleware_stack.build(name) do |env|
      req = ActionDispatch::Request.new(env)
      res = make_response! req
      new.dispatch(name, req, res)
    end
  else
    lambda { |env|
      req = ActionDispatch::Request.new(env)
      res = make_response! req
      new.dispatch(name, req, res)
    }
  end
end