Skip to content

Commit

Permalink
Merge pull request #1 from cloudzilla/master
Browse files Browse the repository at this point in the history
Added test boolean methods
  • Loading branch information
Syl Turner committed Jul 23, 2011
2 parents d4ac54b + f0c0179 commit b51bd5d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.6.3
1.6.4
15 changes: 15 additions & 0 deletions lib/restclient/abstract_response.rb
Expand Up @@ -11,6 +11,21 @@ def code
@code ||= @net_http_res.code.to_i
end

# Has the request been made yet
def requested?
!(@net_http_res.blank? rescue true)
end

# Was there a successful request?
def success?
(requested? && self.return! rescue false) ? true : false
end

# Was there a failed request?
def failed?
requested? && !success?
end

# A hash of the headers, beautified with symbols and underscores.
# e.g. "Content-type" will become :content_type.
def headers
Expand Down

0 comments on commit b51bd5d

Please sign in to comment.