lib/backup/notifier/pushover.rb in backup_zh-4.0.3.1 vs lib/backup/notifier/pushover.rb in backup_zh-4.2.0
- old
+ new
@@ -49,16 +49,10 @@
# `:failure`
# : The backup operation failed.
# : Notification will be sent if `on_warning` or `on_success` is `true`.
#
def notify!(status)
- tag = case status
- when :success then '[Backup::Success]'
- when :failure then '[Backup::Failure]'
- when :warning then '[Backup::Warning]'
- end
- message = "#{ tag } #{ model.label } (#{ model.trigger })"
- send_message(message)
+ send_message(message.call(model, :status => status_data_for(status)))
end
def send_message(message)
uri = 'https://api.pushover.net/1/messages.json'
data = { :user => user, :token => token, :message => message }