class Uploadcare::Entity::Group

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.

@see uploadcare.com/docs/api_reference/upload/groups/

Public Class Methods

store(uuid) click to toggle source

Remove these lines and bump api_struct version when this PR is accepted: @see github.com/rubygarage/api_struct/pull/15

# File lib/uploadcare/entity/group.rb, line 21
def self.store(uuid)
  rest_store(uuid)
end

Public Instance Methods

id() click to toggle source

gets groups's id - even if it's only initialized with cdn_url @return [String]

# File lib/uploadcare/entity/group.rb, line 27
def id
  return @entity.id if @entity.id

  id = @entity.cdn_url.gsub('https://ucarecdn.com/', '')
  id = id.gsub(%r{\/.*}, '')
  id
end
load() click to toggle source

loads group metadata, if it's initialized with url or id

# File lib/uploadcare/entity/group.rb, line 36
def load
  initialize(Group.info(id).entity)
end