Class: Ddr::Alert

Inherits:
AuxiliaryResource show all
Defined in:
app/models/ddr/alert.rb

Constant Summary collapse

ADMIN_SITE =
'admin'
PUBLIC_SITE =
'public'

Class Method Summary collapse

Methods inherited from AuxiliaryResource

cache_key, fetch

Class Method Details

.call(site) ⇒ Array

Returns the active alerts for the requested application site.

Parameters:

  • the (String)

    application (‘admin’ or ‘public’) for which to return active alerts

Returns:

  • (Array)

    the active alerts for the requested application site



11
12
13
14
15
# File 'app/models/ddr/alert.rb', line 11

def self.call(site)
  get(:active, site: site).map { |resp| new(resp) }
rescue ActiveResource::ServerError => e
  []
end