Parent

Files

ActiveResource::Request

Attributes

path[RW]
method[RW]
body[RW]
headers[RW]

Public Class Methods

new(method, path, body = nil, headers = {}) click to toggle source
     # File lib/active_resource/http_mock.rb, line 158
158:     def initialize(method, path, body = nil, headers = {})
159:       @method, @path, @body, @headers = method, path, body, headers
160:     end

Public Instance Methods

==(req) click to toggle source
     # File lib/active_resource/http_mock.rb, line 162
162:     def ==(req)
163:       path == req.path && method == req.method && headers_match?(req)
164:     end
to_s() click to toggle source
     # File lib/active_resource/http_mock.rb, line 166
166:     def to_s
167:       "<#{method.to_s.upcase}: #{path} [#{headers}] (#{body})>"
168:     end

Private Instance Methods

headers_match?(req) click to toggle source
     # File lib/active_resource/http_mock.rb, line 172
172:     def headers_match?(req)
173:       # Ignore format header on equality if it's not defined
174:       format_header = ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[method]
175:       if headers[format_header].present? || req.headers[format_header].blank?
176:         headers == req.headers
177:       else
178:         headers.dup.merge(format_header => req.headers[format_header]) == req.headers
179:       end
180:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.