Class: Commands::Incident

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/lita/commands/incident.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

#callObject



5
6
7
8
9
10
11
# File 'lib/lita/commands/incident.rb', line 5

def call
  incident_id = message.match_data['incident_id']
  incident = pagerduty.get_incident(incident_id)
  response format_incidents([incident])
rescue Exceptions::IncidentNotFound
  response message: 'incident.not_found', params: { id: incident_id }
end