Methods
Attributes
[RW] body
[RW] code
[RW] headers
[RW] message
Public Class methods
new(body, message = 200, headers = {})
     # File activeresource/lib/active_resource/http_mock.rb, line 259
259:     def initialize(body, message = 200, headers = {})
260:       @body, @message, @headers = body, message.to_s, headers
261:       @code = @message[0,3].to_i
262: 
263:       resp_cls = Net::HTTPResponse::CODE_TO_OBJ[@code.to_s]
264:       if resp_cls && !resp_cls.body_permitted?
265:         @body = nil
266:       end
267: 
268:       if @body.nil?
269:         self['Content-Length'] = "0"
270:       else
271:         self['Content-Length'] = body.size.to_s
272:       end
273:     end
Public Instance methods
==(other)
     # File activeresource/lib/active_resource/http_mock.rb, line 287
287:     def ==(other)
288:       if (other.is_a?(Response))
289:         other.body == body && other.message == message && other.headers == headers
290:       else
291:         false
292:       end
293:     end
[](key)
     # File activeresource/lib/active_resource/http_mock.rb, line 279
279:     def [](key)
280:       headers[key]
281:     end
[]=(key, value)
     # File activeresource/lib/active_resource/http_mock.rb, line 283
283:     def []=(key, value)
284:       headers[key] = value
285:     end
success?()
     # File activeresource/lib/active_resource/http_mock.rb, line 275
275:     def success?
276:       (200..299).include?(code)
277:     end