Class ActiveResource::Response
In: activeresource/lib/active_resource/http_mock.rb
Parent: Object

Methods

==   []   []=   new   success?  

Attributes

body  [RW] 
code  [RW] 
headers  [RW] 
message  [RW] 

Public Class methods

[Source]

# File activeresource/lib/active_resource/http_mock.rb, line 105
    def initialize(body, message = 200, headers = {})
      @body, @message, @headers = body, message.to_s, headers
      @code = @message[0,3].to_i
    end

Public Instance methods

[Source]

# File activeresource/lib/active_resource/http_mock.rb, line 122
    def ==(other)
      if (other.is_a?(Response))
        other.body == body && other.message == message && other.headers == headers
      else
        false
      end
    end

[Source]

# File activeresource/lib/active_resource/http_mock.rb, line 114
    def [](key)
      headers[key]
    end

[Source]

# File activeresource/lib/active_resource/http_mock.rb, line 118
    def []=(key, value)
      headers[key] = value
    end

[Source]

# File activeresource/lib/active_resource/http_mock.rb, line 110
    def success?
      (200..299).include?(code)
    end

[Validate]