Module: Sinatra::ResponseHelpers

Included in:
EventContext
Defined in:
lib/codebutler/sinatra.rb

Instance Method Summary collapse

Instance Method Details

#headers(header = nil) ⇒ Object Also known as: header



387
388
389
390
# File 'lib/codebutler/sinatra.rb', line 387

def headers(header = nil)
  @response.headers.merge!(header) if header
  @response.headers
end

#redirect(path, *args) ⇒ Object



381
382
383
384
385
# File 'lib/codebutler/sinatra.rb', line 381

def redirect(path, *args)
  status(302)
  headers 'Location' => path
  throw :halt, *args
end