Module: Roda::RodaPlugins::StatusHandler::InstanceMethods

Defined in:
lib/roda/plugins/status_handler.rb

Instance Method Summary collapse

Instance Method Details

#callObject

If routing returns a response we have a handler for, call that handler.



45
46
47
48
49
50
51
52
53
54
# File 'lib/roda/plugins/status_handler.rb', line 45

def call
  result = super

  if (block = opts[:status_handler][result[0]]) && (v = result[2]).is_a?(Array) && v.empty?
    @_response.headers.clear
    super(&block)
  else
    result
  end
end