Module: Cheat::Controllers::Responder

Included in:
Diff, History
Defined in:
lib/cheat/responder.rb

Defined Under Namespace

Classes: Response

Instance Method Summary collapse

Instance Method Details

#respond_to {|response = Response.new(env.HTTP_ACCEPT)| ... } ⇒ Object

Yields:

  • (response = Response.new(env.HTTP_ACCEPT))


17
18
19
20
21
# File 'lib/cheat/responder.rb', line 17

def respond_to
  yield response = Response.new(env.HTTP_ACCEPT)
  @headers['Content-Type'] = response.content_type
  response.body
end