Class: Miteru::Notifiers::Slack

Inherits:
Base show all
Defined in:
lib/miteru/notifiers/slack.rb

Instance Method Summary collapse

Methods inherited from Base

inherited, #name

Methods inherited from Service

call, #result, result

Instance Method Details

#call(kit) ⇒ Object

Notify to Slack

Parameters:



82
83
84
85
86
87
# File 'lib/miteru/notifiers/slack.rb', line 82

def call(kit)
  return unless callable?

  attachment = SlackAttachment.new(kit.url)
  notifier.post(text: kit.filename_with_size, attachments: attachment.to_a)
end

#callable?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/miteru/notifiers/slack.rb', line 89

def callable?
  !webhook_url.nil?
end