Class: Slack::Notifier::PayloadMiddleware::Channels

Inherits:
Base
  • Object
show all
Defined in:
lib/slack-notifier/payload_middleware/channels.rb

Instance Attribute Summary

Attributes inherited from Base

#notifier, #options

Instance Method Summary collapse

Methods inherited from Base

default_opts, #initialize, middleware_name, options

Constructor Details

This class inherits a constructor from Slack::Notifier::PayloadMiddleware::Base

Instance Method Details

#call(payload = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/slack-notifier/payload_middleware/channels.rb', line 9

def call payload={}
  return payload unless payload[:channel].respond_to?(:to_ary)

  payload[:channel].to_ary.map do |channel|
    pld = payload.dup
    pld[:channel] = channel
    pld
  end
end