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



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