Sha256: 1423128a9c09ede624ba85a09dade25acd13a31ef1aff2bca7c92c8da4607a29
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
class Response # XML response class XML < self HEADERS = IceNine.deep_freeze('Content-Type' => 'application/xml; charset=UTF-8') # 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 # def self.build(body) super(Status::OK, HEADERS, body) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
response-0.0.5 | lib/response/xml.rb |
response-0.0.4 | lib/response/xml.rb |