class Notiffany::Notifier::Config

Configuration class for Notifier

Constants

DEFAULTS

Attributes

env_namespace[R]
logger[R]
notifiers[R]

Public Class Methods

new(opts) click to toggle source
# File lib/notiffany/notifier/config.rb, line 13
def initialize(opts)
  options = DEFAULTS.merge(opts)
  @env_namespace = opts.fetch(:namespace, "notiffany")
  @logger = _setup_logger(options)
  @notify = options[:notify]
  @notifiers = opts.fetch(:notifiers, {})
end

Public Instance Methods

notify?() click to toggle source
# File lib/notiffany/notifier/config.rb, line 21
def notify?
  @notify
end

Private Instance Methods

_setup_logger(opts) click to toggle source
# File lib/notiffany/notifier/config.rb, line 27
def _setup_logger(opts)
  opts.fetch(:logger) do
    Logger.new($stderr).tap { |l| l.level = Logger::WARN }
  end
end