Class: Commands::AckAll
- Inherits:
-
Object
- Object
- Commands::AckAll
- Includes:
- Base
- Defined in:
- lib/lita/commands/ack_all.rb
Instance Method Summary collapse
Methods included from Base
#current_user, #format_incident, #format_incidents, #format_note, #format_notes, included, #initialize, #pagerduty, #response, #store
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/lita/commands/ack_all.rb', line 5 def call ids = pagerduty.get_incidents(query_params).map { |i| i[:id] } pagerduty.manage_incidents(:acknowledge, ids) response message: 'all.acknowledged', params: { list: ids.join(', ') } rescue Exceptions::IncidentsEmptyList response message: 'incident.none' rescue Exceptions::IncidentManageUnsuccess nil end |