Class: Snoopit::Notifier Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/snoopit/notifier.rb

Overview

This class is abstract.

Subclass

Override #notify method

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • name (String) (defaults to: nil)

    name of notifier if the name is nil the class name is used



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

#configurationObject

Returns the value of attribute configuration.



7
8
9
# File 'lib/snoopit/notifier.rb', line 7

def configuration
  @configuration
end

#klassObject

Returns the value of attribute klass.



7
8
9
# File 'lib/snoopit/notifier.rb', line 7

def klass
  @klass
end

#nameObject

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