Module: Uploadcare

Defined in:
lib/uploadcare.rb,
lib/uploadcare/api.rb,
lib/uploadcare/version.rb,
lib/uploadcare/api/raw_api.rb,
lib/uploadcare/api/file_api.rb,
lib/uploadcare/utils/parser.rb,
lib/uploadcare/api/group_api.rb,
lib/uploadcare/errors/errors.rb,
lib/uploadcare/resources/file.rb,
lib/uploadcare/rest/auth/auth.rb,
lib/uploadcare/api/project_api.rb,
lib/uploadcare/resources/group.rb,
lib/uploadcare/rest/auth/secure.rb,
lib/uploadcare/rest/auth/simple.rb,
lib/uploadcare/utils/user_agent.rb,
lib/uploadcare/api/file_list_api.rb,
lib/uploadcare/api/uploading_api.rb,
lib/uploadcare/resources/project.rb,
lib/uploadcare/api/group_list_api.rb,
lib/uploadcare/resources/file_list.rb,
lib/uploadcare/api/file_storage_api.rb,
lib/uploadcare/resources/group_list.rb,
lib/uploadcare/resources/resource_list.rb,
lib/uploadcare/api/uploading_api/upload_params.rb,
lib/uploadcare/rest/connections/api_connection.rb,
lib/uploadcare/rest/middlewares/auth_middleware.rb,
lib/uploadcare/rest/connections/upload_connection.rb,
lib/uploadcare/rest/middlewares/parse_json_middleware.rb,
lib/uploadcare/rest/middlewares/raise_error_middleware.rb,
lib/uploadcare/api/validators/file_list_options_validator.rb,
lib/uploadcare/api/validators/group_list_options_validator.rb

Defined Under Namespace

Modules: Connections, FileApi, FileListApi, FileStorageApi, GroupApi, GroupListApi, Parser, ProjectApi, RawApi, UploadingApi, Validators Classes: Api, Error, UserAgent

Constant Summary collapse

DEFAULT_SETTINGS =
{
  public_key: 'demopublickey',
  private_key: 'demoprivatekey',
  upload_url_base: 'https://upload.uploadcare.com',
  api_url_base: 'https://api.uploadcare.com',
  static_url_base: 'https://ucarecdn.com',
  api_version: '0.5',
  cache_files: true,
  autostore: :auto,
  auth_scheme: :secure,
}
VERSION =
'2.1.2'.freeze

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object


30
31
32
33
34
35
36
37
# File 'lib/uploadcare.rb', line 30

def self.const_missing(name)
  if name == :USER_AGENT
    warn '[DEPRECATION] `Uploadcare::USER_AGENT` constant is deprecated and will be removed in version 3.0'
    "uploadcare-ruby/#{Gem.ruby_version}/#{Uploadcare::VERSION}"
  else
    super
  end
end

.default_settingsObject


21
22
23
# File 'lib/uploadcare.rb', line 21

def self.default_settings
  DEFAULT_SETTINGS
end

.user_agent(options = {}) ⇒ Object


25
26
27
28
# File 'lib/uploadcare.rb', line 25

def self.user_agent(options={})
  warn '[DEPRECATION] `Uploadcare::user_agent` method is deprecated and will be removed in version 3.0'
  UserAgent.new.call(options)
end