Sha256: 73cb66b408331576eed037258a88cfea27b0439a96b841a9ac20007333913b4d
Contents?: true
Size: 640 Bytes
Versions: 44
Compression:
Stored size: 640 Bytes
Contents
require 'restful_model' module Inbox class File < RestfulModel parameter :size parameter :filename parameter :content_type parameter :is_embedded parameter :message_id # For uploading the file parameter :file def inflate(json) super content_type = json["content-type"] if json["content-type"] end def save! ::RestClient.post(url, {:file => @file}) do |response, request, result| json = Inbox.interpret_response(result, response, :expected_class => Object) json = json[0] if (json.class == Array) inflate(json) end self end end end
Version data entries
44 entries across 44 versions & 2 rubygems