class Response::XML

XML response

Constants

HEADERS

Public Class Methods

build(body) click to toggle source

Build xml response with defaults

@param [Object] body

rack compatible body

@return [Response::XML]

@example

# With defaults
response = Response::XML.build("<foo><bar>Hello</bar></foo>")
response.status  # => Response::Status::OK
response.headers # => { 'Content-Type' => 'application/xml; charset=UTF-8' }
response.body    # => "<foo><bar>Hello</bar></foo>"

# With overriding defaults
response = Response::XML.build("<foo><bar>Hello</bar></foo>") do |response|
  response.with_status(Response::Status::NOT_FOUND)
end

response.status  # => Response::Status::NOT_FOUND
response.headers # => { 'Content-Type' => 'application/xml; charset=UTF-8' }
response.body    # => "<foo><bar>Hello</bar></foo>"

@api public

Calls superclass method
# File lib/response/xml.rb, line 32
def self.build(body)
  super(Status::OK, HEADERS, body)
end