Class: Integrity::Notifier

Inherits:
Object show all
Includes:
DataMapper::Resource
Defined in:
lib/integrity/notifier.rb,
lib/integrity/notifier/base.rb

Defined Under Namespace

Classes: Base

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.availableObject



14
15
16
17
18
# File 'lib/integrity/notifier.rb', line 14

def self.available
  @available ||= constants.map {|name| const_get(name) }.select do |notifier|
    notifier.respond_to?(:to_haml) && notifier.respond_to?(:notify_of_build)
  end - [Notifier::Base]
end

.enable_notifiers(project, enabled, config = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/integrity/notifier.rb', line 20

def self.enable_notifiers(project, enabled, config={})
  all.destroy!
  list_of_enabled_notifiers(enabled).each do |name|
    create! :project_id => project, :name => name, :config => config[name]
  end
end

Instance Method Details

#notify_of_build(build) ⇒ Object



27
28
29
# File 'lib/integrity/notifier.rb', line 27

def notify_of_build(build)
  to_const.notify_of_build(build, config)
end