motion/http/response.rb in bubble-wrap-1.3.0 vs motion/http/response.rb in bubble-wrap-1.4.0
- old
+ new
@@ -1,10 +1,10 @@
# Response class wrapping the results of a Query's response
-class BubbleWrap::HTTP::Response
+module BubbleWrap; module HTTP; class Response
attr_reader :body
attr_reader :headers
- attr_accessor :status_code, :status_description, :error_message
+ attr_accessor :status_code, :status_description, :error_message, :error
attr_reader :url
attr_reader :original_url
def initialize(values={})
self.update(values)
@@ -16,17 +16,17 @@
end
update_status_description
end
def ok?
- status_code.to_s =~ /20\d/ ? true : false
+ status_code.to_s =~ /2\d\d/ ? true : false
end
def to_s
"#<#{self.class}:#{self.object_id} - url: #{self.url}, body: #{self.body}, headers: #{self.headers}, status code: #{self.status_code}, error message: #{self.error_message} >"
end
alias description to_s
def update_status_description
@status_description = status_code.nil? ? nil : NSHTTPURLResponse.localizedStringForStatusCode(status_code)
end
-end
\ No newline at end of file
+end; end; end