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.



42
43
44
45
46
47
48
49
50
51
# File 'lib/roda/plugins/status_handler.rb', line 42

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