Skip to content

Commit

Permalink
Allow option setting of incident_key in initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
rabidcarrot committed Mar 19, 2012
1 parent 3450b4e commit aab59b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Usage

Pagerduty exposes three classes, `Pagerduty`, `PagerdutyIncident` and `PagerdutyException`. Instances of `PagerdutyIncident` are created and returned for every API call.

`Pagerduty`'s constructor takes a single argument - your `service_key`. You can then use the method `trigger` to trigger a new incident with Pagerduty:
`Pagerduty`'s constructor takes 2 arguments - your `service_key` and an optional argument to set the 'incident_key' You can then use the method `trigger` to trigger a new incident with Pagerduty:

require 'pagerduty'
p = Pagerduty.new "your_pagerduty_service_key"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.1.2
6 changes: 3 additions & 3 deletions lib/pagerduty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class Pagerduty

attr_reader :service_key, :incident_key

def initialize(service_key)
def initialize(service_key, incident_key = nil)
@service_key = service_key
@incident_key = nil
@incident_key = incident_key
end

def trigger(description, details = {})
Expand Down Expand Up @@ -64,4 +64,4 @@ def resolve(description, details = {})
self
end

end
end

0 comments on commit aab59b7

Please sign in to comment.