class Pagerdupi::Client
Public Class Methods
new(api_token)
click to toggle source
# File lib/pagerdupi/common.rb, line 7 def initialize(api_token) @api_token = api_token @options = { headers: { 'Authorization' => "Token token=#{@api_token}", 'Content-type' => 'application/json', 'Accept' => 'application/vnd.pagerduty+json;version=2' }, output: 'json' } end
Public Instance Methods
delete(req, opts = {})
click to toggle source
# File lib/pagerdupi/common.rb, line 39 def delete(req, opts = {}) opts = opts.merge(@options) self.class.delete("#{req}", opts) end
get(req, opts = {})
click to toggle source
# File lib/pagerdupi/common.rb, line 19 def get(req, opts = {}) opts = opts.merge(@options) self.class.get("#{req}", opts) end
patch(req, opts = {})
click to toggle source
# File lib/pagerdupi/common.rb, line 29 def patch(req, opts = {}) opts = opts.merge(@options) self.class.patch("#{req}", opts) end
post(req, opts = {})
click to toggle source
# File lib/pagerdupi/common.rb, line 24 def post(req, opts = {}) opts = opts.merge(@options) self.class.post("#{req}", opts) end
put(req, opts = {})
click to toggle source
# File lib/pagerdupi/common.rb, line 34 def put(req, opts = {}) opts = opts.merge(@options) self.class.put("#{req}", opts) end