Module: Uploadcare::Rails::Objects::Loadable
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::AttributeAssignment
- Defined in:
- lib/uploadcare/rails/objects/concerns/loadable.rb
Overview
A module that contains methods for attribute assignation and caching
Instance Method Summary collapse
- #cache_expires_in ⇒ Object
- #cache_key ⇒ Object
- #caching_enabled? ⇒ Boolean
- #update_attrs(new_attrs) ⇒ Object
- #uploadcare_configuration ⇒ Object
Instance Method Details
#cache_expires_in ⇒ Object
28 29 30 |
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 28 def cache_expires_in uploadcare_configuration.cache_expires_in end |
#cache_key ⇒ Object
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
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_configuration ⇒ Object
36 37 38 |
# File 'lib/uploadcare/rails/objects/concerns/loadable.rb', line 36 def uploadcare_configuration self.class.uploadcare_configuration end |