Class: ChatworkTo::Notifier
- Inherits:
-
Object
- Object
- ChatworkTo::Notifier
- Defined in:
- lib/chatwork_to/notifier.rb
Instance Method Summary collapse
- #info(message) ⇒ Object
-
#initialize(notifiers) ⇒ Notifier
constructor
A new instance of Notifier.
- #notify(hash) ⇒ Object
Constructor Details
#initialize(notifiers) ⇒ Notifier
Returns a new instance of Notifier.
7 8 9 10 11 12 13 |
# File 'lib/chatwork_to/notifier.rb', line 7 def initialize(notifiers) @notifiers = [] notifiers.each do |notifier| name = notifier.delete('name') @notifiers << "ChatworkTo::Notifiers::#{name.classify}".constantize.new(notifier) end end |
Instance Method Details
#info(message) ⇒ Object
19 20 21 |
# File 'lib/chatwork_to/notifier.rb', line 19 def info() @notifiers.each { |n| n.info() } end |
#notify(hash) ⇒ Object
15 16 17 |
# File 'lib/chatwork_to/notifier.rb', line 15 def notify(hash) @notifiers.each { |n| n.notify(hash) } end |