module CarrierWave::Viewer

Constants

SUPPORTED_TYPES

Private Instance Methods

save_to_groupdocs(file) click to toggle source
# File lib/carrierwave-viewer/viewer.rb, line 12
def save_to_groupdocs(file)
  if SUPPORTED_TYPES.include?(file.content_type)
    groupdocs_file = GroupDocs::Storage::File.upload!(file.path, {name: file.filename}, client_id: self.groupdocs_client_id, private_key: self.groupdocs_private_key)
    self.model.groupdocs_guid = groupdocs_file.guid
    if self.model.respond_to?(:groupdocs_thumbnail=)
      self.model.groupdocs_thumbnail = groupdocs_file.thumbnail
    end
  end
end