Class: Uploadcare::Client::GroupClient

Inherits:
UploadClient
  • Object
show all
Defined in:
lib/uploadcare/client/group_client.rb

Overview

Groups serve a purpose of better organizing files in your Uploadcare projects. You can create one from a set of files by using their UUIDs.

Instance Method Summary collapse

Methods inherited from UploadClient

#api_root, #headers

Methods included from Uploadcare::Concerns::ThrottleHandler

#handle_throttling

Methods included from Uploadcare::Concerns::ErrorHandler

#failure, #wrap

Instance Method Details

#create(file_list, options = {}) ⇒ Object

Create files group from a set of files by using their UUIDs.



13
14
15
16
17
18
19
# File 'lib/uploadcare/client/group_client.rb', line 13

def create(file_list, options = {})
  body_hash = group_body_hash(file_list, options)
  body = HTTP::FormData::Multipart.new(body_hash)
  post(path: 'group/',
       headers: { 'Content-Type': body.content_type },
       body: body)
end

#info(group_id) ⇒ Object

Get group info



23
24
25
# File 'lib/uploadcare/client/group_client.rb', line 23

def info(group_id)
  get(path: 'group/info/', params: { pub_key: Uploadcare.config.public_key, group_id: group_id })
end