Skip to content

Commit

Permalink
adding a to_str and to_i to response for better compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
archiloque committed Mar 19, 2010
1 parent 49420a0 commit 38952b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/restclient/abstract_response.rb
Expand Up @@ -63,6 +63,10 @@ def return! &block
end
end

def to_i
code
end

def inspect
"#{code} #{STATUSES[code]} | #{(headers[:content_type] || '').gsub(/;.*$/, '')} #{size} bytes\n"
end
Expand Down
4 changes: 4 additions & 0 deletions lib/restclient/response.rb
Expand Up @@ -38,6 +38,10 @@ def to_s
body.to_s
end

def to_str
body.to_str
end

def size
body.size
end
Expand Down

0 comments on commit 38952b3

Please sign in to comment.