class MAuth::Rack::Response
representation of a response composed from a rack response (status, headers, body) which can be passed to a Mauth::Client for signing
Public Class Methods
new(status, headers, body)
click to toggle source
# File lib/mauth/rack.rb, line 156 def initialize(status, headers, body) @status = status @headers = headers @body = body end
Public Instance Methods
attributes_for_signing()
click to toggle source
# File lib/mauth/rack.rb, line 166 def attributes_for_signing @attributes_for_signing ||= begin body = '' @body.each { |part| body << part } # note: rack only requires #each be defined on the body, so not using map or inject { status_code: @status.to_i, body: body } end end
merge_headers(headers)
click to toggle source
takes a Hash
of headers; returns an instance of this class whose headers have been updated with the argument headers
# File lib/mauth/rack.rb, line 176 def merge_headers(headers) self.class.new(@status, @headers.merge(headers), @body) end
status_headers_body()
click to toggle source
# File lib/mauth/rack.rb, line 162 def status_headers_body [@status, @headers, @body] end