Class: Notiffany::Notifier::Config
- Inherits:
-
Object
- Object
- Notiffany::Notifier::Config
- Defined in:
- lib/notiffany/notifier/config.rb
Overview
Configuration class for Notifier
Constant Summary collapse
- DEFAULTS =
{ notify: true }.freeze
Instance Attribute Summary collapse
-
#env_namespace ⇒ Object
readonly
Returns the value of attribute env_namespace.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#notifiers ⇒ Object
readonly
Returns the value of attribute notifiers.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Config
constructor
A new instance of Config.
- #notify? ⇒ Boolean
Constructor Details
#initialize(opts) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 |
# File 'lib/notiffany/notifier/config.rb', line 13 def initialize(opts) = DEFAULTS.merge(opts) @env_namespace = opts.fetch(:namespace, "notiffany") @logger = _setup_logger() @notify = [:notify] @notifiers = opts.fetch(:notifiers, {}) end |
Instance Attribute Details
#env_namespace ⇒ Object (readonly)
Returns the value of attribute env_namespace.
9 10 11 |
# File 'lib/notiffany/notifier/config.rb', line 9 def env_namespace @env_namespace end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/notiffany/notifier/config.rb', line 10 def logger @logger end |
#notifiers ⇒ Object (readonly)
Returns the value of attribute notifiers.
11 12 13 |
# File 'lib/notiffany/notifier/config.rb', line 11 def notifiers @notifiers end |
Instance Method Details
#notify? ⇒ Boolean
21 22 23 |
# File 'lib/notiffany/notifier/config.rb', line 21 def notify? @notify end |