Class: Snoopit::Notifier Abstract
- Inherits:
-
Object
- Object
- Snoopit::Notifier
- Defined in:
- lib/snoopit/notifier.rb
Overview
Subclass
Override #notify method
Direct Known Subclasses
Snoopit::Notifiers::Email, Snoopit::Notifiers::Http, Snoopit::Notifiers::Https, Snoopit::Notifiers::Stomp
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(config = nil, name = nil, klass = nil) ⇒ Notifier
constructor
The name is used by the Snooper to identify type of notifier to create The empty constructor is used to initialize the class when loaded dynamically After loaded dynamically the method set_config is called to set the configuration.
- #notify(found, notify_params) ⇒ Object
Constructor Details
#initialize(config = nil, name = nil, klass = nil) ⇒ Notifier
The name is used by the Snooper to identify type of notifier to create The empty constructor is used to initialize the class when loaded dynamically After loaded dynamically the method set_config is called to set the configuration
13 14 15 16 17 |
# File 'lib/snoopit/notifier.rb', line 13 def initialize(config=nil, name=nil, klass=nil) @name = name.nil? ? self.class.name : name @klass = klass.nil? ? self.class.name : klass @config = config end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/snoopit/notifier.rb', line 7 def configuration @configuration end |
#klass ⇒ Object
Returns the value of attribute klass.
7 8 9 |
# File 'lib/snoopit/notifier.rb', line 7 def klass @klass end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/snoopit/notifier.rb', line 7 def name @name end |
Instance Method Details
#notify(found, notify_params) ⇒ Object
19 20 21 |
# File 'lib/snoopit/notifier.rb', line 19 def notify(found, notify_params) raise NotImplementedError.new 'Notifier#notify' end |