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.
-
#team ⇒ Object
The Team name.
-
#token ⇒ Object
The Integration Token.
-
#username ⇒ Object
The username to display along with the notification.
Attributes inherited from Base
#max_retries, #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.
40 41 42 43 44 45 46 |
# File 'lib/backup/notifier/slack.rb', line 40 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
19 20 21 |
# File 'lib/backup/notifier/slack.rb', line 19 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:
31 32 33 |
# File 'lib/backup/notifier/slack.rb', line 31 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]
38 39 40 |
# File 'lib/backup/notifier/slack.rb', line 38 def send_log_on @send_log_on end |
#team ⇒ Object
The Team name
11 12 13 |
# File 'lib/backup/notifier/slack.rb', line 11 def team @team end |
#token ⇒ Object
The Integration Token
15 16 17 |
# File 'lib/backup/notifier/slack.rb', line 15 def token @token end |
#username ⇒ Object
The username to display along with the notification
23 24 25 |
# File 'lib/backup/notifier/slack.rb', line 23 def username @username end |