Class: KnifeSantoku::Notifier

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Notifier

def initialize(config, lib_folder)



4
5
6
7
8
9
10
# File 'lib/knife_santoku/notifier.rb', line 4

def initialize(config)
  @config = config
  
  @notifiers = { :hipchat => ::KnifeSantoku::Notification::HipchatNotifier, :campfire => ::KnifeSantoku::Notification::CampfireNotifier }
  
  # iterate through our internal folder and our external folder for notification classes
end

Instance Method Details

#notify(type, msg) ⇒ Object



12
13
14
15
16
17
# File 'lib/knife_santoku/notifier.rb', line 12

def notify(type, msg)
  klass = @notifiers[type]
  notifier = klass.new(@config)
  
  notifier.notify(msg)
end