Class: HipchatRoom
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- HipchatRoom
- Defined in:
- app/models/hipchat_room.rb
Instance Method Summary collapse
- #accept_notify?(deploy) ⇒ Boolean
- #always_notify? ⇒ Boolean
-
#multi_message? ⇒ Boolean
Check if we can send multi message to this room Our logic: notify_on = suceeded only has to be single message becase we will only notify on succeeded.
- #only_notify_suceeded? ⇒ Boolean
Instance Method Details
#accept_notify?(deploy) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/hipchat_room.rb', line 13 def accept_notify?(deploy) if deploy.job.failed? || deploy.job.errored? return always_notify? end if deploy.job.succeeded? return always_notify? || only_notify_suceeded? end # Other status, we will only notifiy if we enable always notify return always_notify? end |
#always_notify? ⇒ Boolean
5 6 7 |
# File 'app/models/hipchat_room.rb', line 5 def always_notify? return notify_on == "always" end |
#multi_message? ⇒ Boolean
Check if we can send multi message to this room Our logic: notify_on = suceeded only has to be single message becase we will only notify on succeeded
29 30 31 |
# File 'app/models/hipchat_room.rb', line 29 def return notify_on == "always" end |
#only_notify_suceeded? ⇒ Boolean
9 10 11 |
# File 'app/models/hipchat_room.rb', line 9 def only_notify_suceeded? return notify_on == "succeeded" end |