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 228
228:     def initialize(method, path, body = nil, headers = {})
229:       @method, @path, @body, @headers = method, path, body, headers
230:     end

Public Instance Methods

==(req) click to toggle source
     # File lib/active_resource/http_mock.rb, line 232
232:     def ==(req)
233:       path == req.path && method == req.method && headers_match?(req)
234:     end
to_s() click to toggle source
     # File lib/active_resource/http_mock.rb, line 236
236:     def to_s
237:       "<#{method.to_s.upcase}: #{path} [#{headers}] (#{body})>"
238:     end

Private Instance Methods

headers_match?(req) click to toggle source
     # File lib/active_resource/http_mock.rb, line 242
242:     def headers_match?(req)
243:       # Ignore format header on equality if it's not defined
244:       format_header = ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[method]
245:       if headers[format_header].present? || req.headers[format_header].blank?
246:         headers == req.headers
247:       else
248:         headers.dup.merge(format_header => req.headers[format_header]) == req.headers
249:       end
250:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.