Class: ChatNotifier::Messenger::Failure
Instance Attribute Summary
#app, #environment, #repository, #summary
Instance Method Summary
collapse
debug=, #digest, #failures, for, #identifier, #initialize, #resolved?, #thread_key, #to_h, #to_hash
Instance Method Details
#body ⇒ Object
135
136
137
|
# File 'lib/chat_notifier/messenger.rb', line 135
def body
failures.flat_map(&:location).join("\n")
end
|
#count ⇒ Object
107
|
# File 'lib/chat_notifier/messenger.rb', line 107
def count = "#{failures.size} times!"
|
#failure? ⇒ Boolean
113
|
# File 'lib/chat_notifier/messenger.rb', line 113
def failure? = !success?
|
#lede ⇒ Object
119
120
121
122
123
124
125
|
# File 'lib/chat_notifier/messenger.rb', line 119
def lede
<<~LEDE.chomp
#{message_prefix} #{identifier} has failed #{count} in #{branch}
#{environment.test_run_url}
LEDE
end
|
#message ⇒ Object
127
128
129
130
131
132
133
|
# File 'lib/chat_notifier/messenger.rb', line 127
def message
<<~MESSAGE.chomp
#{lede}
#{body}
MESSAGE
end
|
#message_prefix ⇒ Object
109
|
# File 'lib/chat_notifier/messenger.rb', line 109
def message_prefix = ":boom:"
|
#status_report ⇒ Object
115
116
117
|
# File 'lib/chat_notifier/messenger.rb', line 115
def status_report
super.merge(status: "failed", failures: failures.size)
end
|
#success? ⇒ Boolean
111
|
# File 'lib/chat_notifier/messenger.rb', line 111
def success? = false
|