Module: GClouder::Resources::Storage::Notifications

Includes:
Logging, Shell
Defined in:
lib/gclouder/resources/storage/notifications.rb

Defined Under Namespace

Modules: Local, Notification

Class Method Summary collapse

Methods included from Shell

included, #shell

Methods included from Logging

#add, #bad, #change, #debug, #error, #fatal, #good, included, #info, log, loggers, #remove, report, #resource_state, setup, #warn, #warning

Class Method Details

.ensureObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gclouder/resources/storage/notifications.rb', line 20

def self.ensure
  return if Local.list.empty?
  header

  Local.list.each do |region, region_config|
    info region, heading: true, indent: 2
    region_config.each do |notification|
      info
      Notification.ensure(notification)
    end
  end
end

.header(stage = :ensure) ⇒ Object



10
11
12
# File 'lib/gclouder/resources/storage/notifications.rb', line 10

def self.header(stage = :ensure)
  info "[#{stage}] storage / notifications", title: true, indent: 1
end

.validateObject



14
15
16
17
18
# File 'lib/gclouder/resources/storage/notifications.rb', line 14

def self.validate
  return if Local.list.empty?
  header :validate
  Local.validate
end