Module: Roda::RodaPlugins::StatusHandler::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#freezeObject

Freeze the hash of status handlers so that there can be no thread safety issues at runtime.



41
42
43
44
# File 'lib/roda/plugins/status_handler.rb', line 41

def freeze
  opts[:status_handler].freeze
  super
end

#status_handler(code, &block) ⇒ Object

Install the given block as a status handler for the given HTTP response code.



36
37
38
# File 'lib/roda/plugins/status_handler.rb', line 36

def status_handler(code, &block)
  opts[:status_handler][code] = block
end