Class: Backup::Notifier::Hipchat
- Defined in:
- lib/backup/notifier/hipchat.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
The Hipchat API version Either ‘v1’ or ‘v2’ (default is ‘v1’).
-
#failure_color ⇒ Object
The background color of an error message.
-
#from ⇒ Object
Who the notification should appear from.
-
#notify_users ⇒ Object
Notify users in the room.
-
#rooms_notified ⇒ Object
The rooms that should be notified.
-
#server_url ⇒ Object
Custom server URL.
-
#success_color ⇒ Object
The background color of a success message.
-
#token ⇒ Object
The Hipchat API token.
-
#warning_color ⇒ Object
The background color of a warning message.
Attributes inherited from Base
#max_retries, #message, #model, #on_failure, #on_success, #on_warning, #retry_waitsec
Instance Method Summary collapse
-
#initialize(model, &block) ⇒ Hipchat
constructor
A new instance of Hipchat.
Methods inherited from Base
Methods included from Config::Helpers
Constructor Details
#initialize(model, &block) ⇒ Hipchat
Returns a new instance of Hipchat.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/backup/notifier/hipchat.rb', line 48 def initialize(model, &block) super instance_eval(&block) if block_given? @notify_users ||= false @rooms_notified ||= [] @success_color ||= 'yellow' @warning_color ||= 'yellow' @failure_color ||= 'yellow' @api_version ||= 'v1' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers
Instance Attribute Details
#api_version ⇒ Object
The Hipchat API version Either ‘v1’ or ‘v2’ (default is ‘v1’)
15 16 17 |
# File 'lib/backup/notifier/hipchat.rb', line 15 def api_version @api_version end |
#failure_color ⇒ Object
The background color of an error message. One of :yellow, :red, :green, :purple, or :random. (default: yellow)
46 47 48 |
# File 'lib/backup/notifier/hipchat.rb', line 46 def failure_color @failure_color end |
#from ⇒ Object
Who the notification should appear from
19 20 21 |
# File 'lib/backup/notifier/hipchat.rb', line 19 def from @from end |
#notify_users ⇒ Object
Notify users in the room
31 32 33 |
# File 'lib/backup/notifier/hipchat.rb', line 31 def notify_users @notify_users end |
#rooms_notified ⇒ Object
The rooms that should be notified
27 28 29 |
# File 'lib/backup/notifier/hipchat.rb', line 27 def rooms_notified @rooms_notified end |
#server_url ⇒ Object
Custom server URL
23 24 25 |
# File 'lib/backup/notifier/hipchat.rb', line 23 def server_url @server_url end |
#success_color ⇒ Object
The background color of a success message. One of :yellow, :red, :green, :purple, or :random. (default: yellow)
36 37 38 |
# File 'lib/backup/notifier/hipchat.rb', line 36 def success_color @success_color end |
#token ⇒ Object
The Hipchat API token
10 11 12 |
# File 'lib/backup/notifier/hipchat.rb', line 10 def token @token end |
#warning_color ⇒ Object
The background color of a warning message. One of :yellow, :red, :green, :purple, or :random. (default: yellow)
41 42 43 |
# File 'lib/backup/notifier/hipchat.rb', line 41 def warning_color @warning_color end |