Class: HipchatNotification
- Inherits:
-
Object
- Object
- HipchatNotification
- Defined in:
- app/models/hipchat_notification.rb
Defined Under Namespace
Classes: Message
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(deploy) ⇒ HipchatNotification
constructor
A new instance of HipchatNotification.
Constructor Details
#initialize(deploy) ⇒ HipchatNotification
3 4 5 6 |
# File 'app/models/hipchat_notification.rb', line 3 def initialize(deploy) @deploy = deploy @stage = deploy.stage end |
Instance Method Details
#deliver ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/hipchat_notification.rb', line 8 def deliver = Message.new(@deploy) begin hipchat[@stage.hipchat_rooms.first.name].send .from, .to_s, **.style rescue HipChat::UnknownRoom => e Rails.logger.error("Room did not existed") rescue HipChat:: => e Rails.logger.error("Invalid token to post to room") rescue HipChat::UnknownResponseCode => e Rails.logger.error("Could not deliver hipchat message: #{e.message}") end end |