Class: Ddr::AuxiliaryResource
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- Ddr::AuxiliaryResource
- Defined in:
- app/models/ddr/auxiliary_resource.rb
Overview
Abstract superclass for resources bound to ddr-aux API data
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.cache_key(suffix) ⇒ Object
19 20 21 |
# File 'app/models/ddr/auxiliary_resource.rb', line 19 def self.cache_key(suffix) [ model_name.cache_key, suffix ].join('/') end |
.fetch(value_key, &block) ⇒ Object
15 16 17 |
# File 'app/models/ddr/auxiliary_resource.rb', line 15 def self.fetch(value_key, &block) Rails.cache.fetch(cache_key(value_key), expires_in: cache_expiry, &block) end |