Class: Low::Events::ResponseFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/factories/response_factory.rb

Class Method Summary collapse

Class Method Details

.response(body:) ⇒ Object



9
10
11
12
13
14
# File 'lib/factories/response_factory.rb', line 9

def response(body:)
  headers = Protocol::HTTP::Headers.new(['content-type', 'text/html'])
  body = Protocol::HTTP::Body::Buffered.wrap(body)

  Protocol::HTTP::Response.new('http/1.1', 200, headers, body)
end