Class: Backup::Notifier::Slack
- Defined in:
- lib/backup/notifier/slack.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
The channel to send messages to.
-
#icon_emoji ⇒ Object
The emoji icon to display along with the notification.
-
#send_log_on ⇒ Object
Array of statuses for which the log file should be attached.
-
#username ⇒ Object
The username to display along with the notification.
-
#webhook_url ⇒ Object
The incoming webhook url.
Attributes inherited from Base
#max_retries, #message, #model, #on_failure, #on_success, #on_warning, #retry_waitsec
Instance Method Summary collapse
-
#initialize(model, &block) ⇒ Slack
constructor
A new instance of Slack.
Methods inherited from Base
Methods included from Config::Helpers
Constructor Details
#initialize(model, &block) ⇒ Slack
Returns a new instance of Slack.
36 37 38 39 40 41 42 |
# File 'lib/backup/notifier/slack.rb', line 36 def initialize(model, &block) super instance_eval(&block) if block_given? @send_log_on ||= [:warning, :failure] @icon_emoji ||= ':floppy_disk:' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers
Instance Attribute Details
#channel ⇒ Object
The channel to send messages to
15 16 17 |
# File 'lib/backup/notifier/slack.rb', line 15 def channel @channel end |
#icon_emoji ⇒ Object
The emoji icon to display along with the notification
See www.emoji-cheat-sheet.com for a list of icons.
Default: :floppy_disk:
27 28 29 |
# File 'lib/backup/notifier/slack.rb', line 27 def icon_emoji @icon_emoji end |
#send_log_on ⇒ Object
Array of statuses for which the log file should be attached.
Available statuses are: ‘:success`, `:warning` and `:failure`. Default: [:warning, :failure]
34 35 36 |
# File 'lib/backup/notifier/slack.rb', line 34 def send_log_on @send_log_on end |
#username ⇒ Object
The username to display along with the notification
19 20 21 |
# File 'lib/backup/notifier/slack.rb', line 19 def username @username end |
#webhook_url ⇒ Object
The incoming webhook url
11 12 13 |
# File 'lib/backup/notifier/slack.rb', line 11 def webhook_url @webhook_url end |