Class: Uploadcare::Client::GroupClient
- Inherits:
-
UploadClient
- Object
- ApiStruct::Client
- UploadClient
- Uploadcare::Client::GroupClient
- 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
-
#create(file_list, options = {}) ⇒ Object
Create files group from a set of files by using their UUIDs.
-
#info(group_id) ⇒ Object
Get group info.
Methods inherited from UploadClient
Methods included from Uploadcare::Concerns::ThrottleHandler
Methods included from Uploadcare::Concerns::ErrorHandler
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, = {}) body_hash = group_body_hash(file_list, ) 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 |