Class: FlowdockBuildNotifier::NotificationMessage
- Inherits:
-
Object
- Object
- FlowdockBuildNotifier::NotificationMessage
- Defined in:
- lib/flowdock_build_notifier/notification_message.rb
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
Instance Method Summary collapse
- #branch ⇒ Object
-
#initialize(build) ⇒ NotificationMessage
constructor
A new instance of NotificationMessage.
- #pass_status ⇒ Object
- #status ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(build) ⇒ NotificationMessage
Returns a new instance of NotificationMessage.
4 5 6 |
# File 'lib/flowdock_build_notifier/notification_message.rb', line 4 def initialize(build) @build = build end |
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
3 4 5 |
# File 'lib/flowdock_build_notifier/notification_message.rb', line 3 def build @build end |
Instance Method Details
#branch ⇒ Object
12 13 14 |
# File 'lib/flowdock_build_notifier/notification_message.rb', line 12 def branch " for branch #{build.branch}" if build.branch end |
#pass_status ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/flowdock_build_notifier/notification_message.rb', line 24 def pass_status case build.name when /deploy/i "🚀 DEPLOYED" when /smoke/i "🚬 SMOKED" else "✅ PASSED" end end |
#status ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/flowdock_build_notifier/notification_message.rb', line 16 def status { "SUCCESS" => "#{pass_status}", "FAILURE" => "❌ FAILED", "UNKNOWN" => "🚧 CANCELED", }[build.status] end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/flowdock_build_notifier/notification_message.rb', line 8 def to_s "#{status}: \"#{build.name}\" build#{branch} - #{build.url}" end |