# File lib/active_resource/http_mock.rb, line 286 286: def initialize(body, message = 200, headers = {}) 287: @body, @message, @headers = body, message.to_s, headers 288: @code = @message[0,3].to_i 289: 290: resp_cls = Net::HTTPResponse::CODE_TO_OBJ[@code.to_s] 291: if resp_cls && !resp_cls.body_permitted? 292: @body = nil 293: end 294: 295: if @body.nil? 296: self['Content-Length'] = "0" 297: else 298: self['Content-Length'] = body.size.to_s 299: end 300: end
Returns true if the other is a Response with an equal body, equal message and equal headers. Otherwise it returns false.
# File lib/active_resource/http_mock.rb, line 318 318: def ==(other) 319: if (other.is_a?(Response)) 320: other.body == body && other.message == message && other.headers == headers 321: else 322: false 323: end 324: end
# File lib/active_resource/http_mock.rb, line 308 308: def [](key) 309: headers[key] 310: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.