lib/duracloud/response.rb in duracloud-client-0.5.0 vs lib/duracloud/response.rb in duracloud-client-0.6.0
- old
+ new
@@ -6,11 +6,11 @@
attr_reader :original_response
delegate [:header, :body, :code, :ok?, :redirect?, :status, :reason] => :original_response,
:content_type => :header,
- [:size, :empty?] => :body
+ :empty? => :body
def_delegator :header, :request_uri, :url
def_delegator :header, :request_method
def initialize(original_response)
@@ -36,8 +36,12 @@
end
end
def md5
header["content-md5"].first
+ end
+
+ def size
+ header["content-length"].first.to_i rescue nil
end
end
end