lib/file.rb in inbox-1.0.0 vs lib/file.rb in inbox-1.1.0
- old
+ new
@@ -3,10 +3,11 @@
module Inbox
class File < RestfulModel
parameter :size
parameter :filename
+ parameter :content_id
parameter :content_type
parameter :is_embedded
parameter :message_id
# For uploading the file
@@ -22,9 +23,17 @@
json = Inbox.interpret_response(result, response, :expected_class => Object)
json = json[0] if (json.class == Array)
inflate(json)
end
self
+ end
+
+ def download
+ download_url = self.url('download')
+ ::RestClient.get(download_url) do |response, request, result|
+ Inbox.interpret_http_status(result)
+ response
+ end
end
end
end