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
# File 'lib/integrity/notifier.rb', line 14

def self.available
  @available ||= constants.map { |name| const_get(name) }.select { |notifier| valid_notifier?(notifier) }
end

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



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

def self.enable_notifiers(project, enabled, config={})
  all(:project_id => project).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



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

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