Class: ActsAsNotifiableRedmine::Notifications

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_notifiable_redmine/notifications.rb

Constant Summary collapse

@@channels =
{}
@@courier =
nil

Class Method Summary collapse

Class Method Details

.channelsObject



19
20
21
# File 'lib/acts_as_notifiable_redmine/notifications.rb', line 19

def channels
  @@channels
end

.courierObject



24
25
26
# File 'lib/acts_as_notifiable_redmine/notifications.rb', line 24

def courier
  @@courier
end

.find_by_id(id) ⇒ Object



29
30
31
# File 'lib/acts_as_notifiable_redmine/notifications.rb', line 29

def find_by_id(id)
  @@channels[id.to_sym]
end

.register_channel(id, &block) ⇒ Object



14
15
16
# File 'lib/acts_as_notifiable_redmine/notifications.rb', line 14

def register_channel(id, &block)
  @@channels[id] = Channel.new(id, &block)
end

.register_courier(type, &block) ⇒ Object



9
10
11
# File 'lib/acts_as_notifiable_redmine/notifications.rb', line 9

def register_courier(type, &block)
  @@courier = Couriers.factory(type, &block)
end

.send_notification(channels, event, options) ⇒ Object



34
35
36
# File 'lib/acts_as_notifiable_redmine/notifications.rb', line 34

def send_notification(channels, event, options)
  @@courier.send_notification(channels, event, options)
end