class Response::Text
TEXT response
Constants
- HEADERS
Public Class Methods
build(body)
click to toggle source
Build text response with defaults
@param [Object] body
rack compatible body
@return [Response::Text]
@example
# With defaults response = Response::Text.build('foo') response.status # => Response::Status::OK response.headers # => { 'Content-Type' => 'text/plain; charset=UTF-8' } response.body # => "foo" # With overriding defaults response = Response::Text.build('foo') do |response| response.with_status(Respnse::Status::NOT_FOUND) end response.status # => Response::Status::NOT_FOUND response.headers # => { 'Content-Type' => 'text/plain; charset=UTF-8' } response.body # => "foo"
@api public
Calls superclass method
# File lib/response/text.rb, line 32 def self.build(body) super(Status::OK, HEADERS, body) end