Class: Plz::Response
- Inherits:
-
Object
- Object
- Plz::Response
- Defined in:
- lib/plz/response.rb
Constant Summary collapse
- TEMPLATE =
<<-EOS.strip_heredoc HTTP/1.1 %{status} %{headers} %{body} EOS
Instance Method Summary collapse
-
#initialize(raw) ⇒ Response
constructor
A new instance of Response.
- #render ⇒ String
Constructor Details
#initialize(raw) ⇒ Response
Returns a new instance of Response.
11 12 13 |
# File 'lib/plz/response.rb', line 11 def initialize(raw) @raw = raw end |
Instance Method Details
#render ⇒ String
16 17 18 19 20 21 22 |
# File 'lib/plz/response.rb', line 16 def render TEMPLATE % { status: status, headers: headers.join("\n"), body: body, } end |