Class: Ddr::AuxiliaryResource

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
app/models/ddr/auxiliary_resource.rb

Overview

Abstract superclass for resources bound to ddr-aux API data

Direct Known Subclasses

Alert

Class Method Summary collapse

Class Method Details

.cache_key(suffix) ⇒ Object



21
22
23
# File 'app/models/ddr/auxiliary_resource.rb', line 21

def self.cache_key(suffix)
  [ model_name.cache_key, suffix ].join('/')
end

.fetch(value_key, &block) ⇒ Object



17
18
19
# File 'app/models/ddr/auxiliary_resource.rb', line 17

def self.fetch(value_key, &block)
  Rails.cache.fetch(cache_key(value_key), expires_in: cache_expiry, &block)
end