Class: Commands::IncidentsMine

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/lita/commands/incidents_mine.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
12
# File 'lib/lita/commands/incidents_mine.rb', line 5

def call
  incidents = pagerduty.get_incidents(query_params)
  response format_incidents(incidents)
rescue Exceptions::IncidentsEmptyList
  response message: 'incident.none'
rescue Exceptions::UserNotIdentified
  response message: 'incident.none_mine'
end