Skip to content

Commit

Permalink
describe return values
Browse files Browse the repository at this point in the history
  • Loading branch information
orien committed May 23, 2014
1 parent b93a405 commit 6b0732f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/pagerduty.rb
Expand Up @@ -49,12 +49,16 @@ def initialize(service_key)
# @option options [Hash] :details An arbitrary hash containing any data you'd
# like included in the incident log.
#
# @return [PagerdutyIncident] The triggered incident.
#
def trigger(description, options = {})
resp = api_call("trigger", options.merge(:description => description))
ensure_success(resp)
PagerdutyIncident.new service_key, resp["incident_key"]
end

# @return [PagerdutyIncident] The incident referenced by the key.
#
def get_incident(incident_key)
PagerdutyIncident.new service_key, incident_key
end
Expand Down Expand Up @@ -105,6 +109,8 @@ def initialize(service_key, incident_key)
# @param [Hash] details An arbitrary hash containing any data you'd like
# included in the incident log.
#
# @return [PagerdutyIncident] self
#
def acknowledge(description = nil, details = nil)
modify_incident("acknowledge", description, details)
end
Expand All @@ -121,6 +127,8 @@ def acknowledge(description = nil, details = nil)
# @param [Hash] details An arbitrary hash containing any data you'd like
# included in the incident log.
#
# @return [PagerdutyIncident] self
#
def resolve(description = nil, details = nil)
modify_incident("resolve", description, details)
end
Expand Down

0 comments on commit 6b0732f

Please sign in to comment.