Module: Uploadcare::Rails::Objects::Loadable

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::AttributeAssignment
Included in:
File, Group
Defined in:
lib/uploadcare/rails/objects/concerns/loadable.rb

Overview

A module that contains methods for attribute assignation and caching

Instance Method Summary collapse

Instance Method Details

#cache_expires_inObject



28
29
30
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 28

def cache_expires_in
  uploadcare_configuration.cache_expires_in
end

#cache_keyObject



40
41
42
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 40

def cache_key
  self.class.build_cache_key(cdn_url)
end

#caching_enabled?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 32

def caching_enabled?
  uploadcare_configuration.cache_files
end

#update_attrs(new_attrs) ⇒ Object



23
24
25
26
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 23

def update_attrs(new_attrs)
  assign_attributes(new_attrs)
  self
end

#uploadcare_configurationObject



36
37
38
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 36

def uploadcare_configuration
  self.class.uploadcare_configuration
end