Sha256: 3d9f6895c528acb30f2fd70675d8657baaa48fbf524eb7682845fa503aa28c99

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

# encoding: utf-8

module Backup
  module Configuration
    module Notifier
      class Base < Backup::Configuration::Base
        class << self

          ##
          # When set to true, the user will be notified by email
          # when a backup process ends without raising any exceptions
          attr_writer :on_success

          ##
          # When set to true, the user will be notified by email
          # when a backup process ends successfully, but logged warnings
          attr_writer :on_warning

          ##
          # When set to true, the user will be notified by email
          # when a backup process raises an exception before finishing
          attr_writer :on_failure

        end

        ##
        # When @on_success is nil it means it hasn't been defined
        # and will then default to true
        def self.on_success
          return true if @on_success.nil?
          @on_success
        end

        ##
        # When @on_success is nil it means it hasn't been defined
        # and will then default to true
        def self.on_warning
          return true if @on_warning.nil?
          @on_warning
        end

        ##
        # When @on_failure is nil it means it hasn't been defined
        # and will then default to true
        def self.on_failure
          return true if @on_failure.nil?
          @on_failure
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
backup-3.0.20 lib/backup/configuration/notifier/base.rb