Permalink
Browse files

Added some docs on ActiveResource::HttpMock

  • Loading branch information...
1 parent 825dae1 commit 06b91381889fcbd32018ab045b1795ada8718cad @smartinez87 smartinez87 committed May 1, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 activeresource/lib/active_resource/http_mock.rb
@@ -299,6 +299,8 @@ def initialize(body, message = 200, headers = {})
end
end
+ # Returns true if code is 2xx,
+ # false otherwise.
def success?
code.in?(200..299)
end
@@ -311,6 +313,8 @@ def []=(key, value)
headers[key] = value
end
+ # Returns true if the other is a Response with an equal body, equal message
+ # and equal headers. Otherwise it returns false.
def ==(other)
if (other.is_a?(Response))
other.body == body && other.message == message && other.headers == headers

0 comments on commit 06b9138

Please sign in to comment.