Class: Slack::Mailer::DeliveryWorker
- Inherits:
-
Object
- Object
- Slack::Mailer::DeliveryWorker
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/slack_mailer/delivery_worker.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#retry_count ⇒ Object
Returns the value of attribute retry_count.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
16 17 18 |
# File 'lib/slack_mailer/delivery_worker.rb', line 16 def channel @channel end |
#message ⇒ Object
Returns the value of attribute message.
16 17 18 |
# File 'lib/slack_mailer/delivery_worker.rb', line 16 def end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/slack_mailer/delivery_worker.rb', line 16 def name @name end |
#retry_count ⇒ Object
Returns the value of attribute retry_count.
16 17 18 |
# File 'lib/slack_mailer/delivery_worker.rb', line 16 def retry_count @retry_count end |
#url ⇒ Object
Returns the value of attribute url.
16 17 18 |
# File 'lib/slack_mailer/delivery_worker.rb', line 16 def url @url end |
Instance Method Details
#perform(params) ⇒ Object
22 23 24 25 26 |
# File 'lib/slack_mailer/delivery_worker.rb', line 22 def perform(params) params['url'] = Slack::Mailer::Configuration.config.slack_hook_urls[retry_count] params.each{ |attribute, value| send("#{attribute}=", value) if respond_to?(attribute) } Slack::Notifier.new(url, username: name, channel: channel, link_names: 1).ping() end |