Class: TrackerHub::Request::Notification
- Inherits:
-
Object
- Object
- TrackerHub::Request::Notification
- Defined in:
- lib/tracker_hub/request/notification.rb,
lib/tracker_hub/request/notification/hip_chat.rb
Overview
Notify a configured service when an error occured during the request log process
Defined Under Namespace
Classes: HipChat
Constant Summary collapse
- KEY_CACHE =
Key to cache the timelapse between 2 notifications
'trackinghub_request_notification'.freeze
Instance Attribute Summary collapse
-
#notifier ⇒ Object
readonly
The notification adapter.
-
#options ⇒ Hash
readonly
Notification and notifier options.
-
#timelapse ⇒ Integer|ActiveSupport::Duration
readonly
Timelapse between 2 notifications.
Instance Method Summary collapse
-
#notify(message, args = {}) ⇒ undefined
Trigger a notification paused by a timelapse if specified.
Instance Attribute Details
#notifier ⇒ Object
Returns the notification adapter.
12 13 14 |
# File 'lib/tracker_hub/request/notification.rb', line 12 def notifier @notifier end |
#options ⇒ Hash
Returns notification and notifier options.
20 21 22 |
# File 'lib/tracker_hub/request/notification.rb', line 20 def @options end |
#timelapse ⇒ Integer|ActiveSupport::Duration
Returns timelapse between 2 notifications.
16 17 18 |
# File 'lib/tracker_hub/request/notification.rb', line 16 def timelapse @timelapse end |
Instance Method Details
#notify(message, args = {}) ⇒ undefined
Trigger a notification paused by a timelapse if specified
35 36 37 38 39 40 41 |
# File 'lib/tracker_hub/request/notification.rb', line 35 def notify(, args = {}) timelapser do notifier.(, .merge(args)) end rescue false end |