Module: Uploadcare::Rails

Defined in:
lib/uploadcare-rails.rb,
lib/uploadcare/rails.rb,
lib/uploadcare/rails/engine.rb,
lib/uploadcare/rails/version.rb,
lib/uploadcare/rails/objects/file.rb,
lib/uploadcare/rails/api/rest/base.rb,
lib/uploadcare/rails/configuration.rb,
lib/uploadcare/rails/objects/group.rb,
lib/uploadcare/rails/api/upload/base.rb,
lib/uploadcare/rails/api/rest/file_api.rb,
lib/uploadcare/rails/api/rest/group_api.rb,
lib/uploadcare/rails/api/rest/addons_api.rb,
lib/uploadcare/rails/jobs/store_file_job.rb,
lib/uploadcare/rails/api/rest/project_api.rb,
lib/uploadcare/rails/api/rest/webhook_api.rb,
lib/uploadcare/rails/jobs/delete_file_job.rb,
lib/uploadcare/rails/jobs/store_group_job.rb,
lib/uploadcare/rails/api/upload/upload_api.rb,
lib/uploadcare/rails/services/id_extractor.rb,
lib/uploadcare/rails/api/rest/conversion_api.rb,
lib/uploadcare/rails/objects/concerns/loadable.rb,
lib/uploadcare/rails/api/rest/file_metadata_api.rb,
lib/uploadcare/rails/mongoid/mount_uploadcare_file.rb,
lib/uploadcare/rails/services/files_count_extractor.rb,
lib/uploadcare/rails/action_view/uploadcare_include_tags.rb,
lib/uploadcare/rails/active_record/mount_uploadcare_file.rb,
lib/uploadcare/rails/mongoid/mount_uploadcare_file_group.rb,
lib/uploadcare/rails/action_view/uploadcare_uploader_tags.rb,
lib/uploadcare/rails/transformations/image_transformations.rb,
lib/uploadcare/rails/active_record/mount_uploadcare_file_group.rb

Overview

A root module for the gem

Defined Under Namespace

Modules: ActionView, ActiveRecord, Api, Mongoid, Objects, Transformations Classes: Configuration, DeleteFileJob, Engine, Error, File, FilesCountExtractor, Group, IdExtractor, StoreFileJob, StoreGroupJob

Constant Summary collapse

VERSION =
'3.4.4'

Class Method Summary collapse

Class Method Details

.configurationObject



34
35
36
# File 'lib/uploadcare-rails.rb', line 34

def configuration
  @configuration
end

.configure {|configuration| ... } ⇒ Object

Yields:



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

def configure
  yield configuration
  overwrite_ruby_config
end

.initialize_configObject



38
39
40
# File 'lib/uploadcare-rails.rb', line 38

def initialize_config
  @configuration = Uploadcare::Rails::Configuration.instance
end

.overwrite_ruby_configObject



26
27
28
29
30
31
32
# File 'lib/uploadcare-rails.rb', line 26

def overwrite_ruby_config
  # copy Rails config to Ruby config
  %i[public_key secret_key].each do |param_name|
    value = configuration.public_send(param_name)
    Uploadcare.config[param_name] = value unless value.nil?
  end
end