Sha256: 9b7b9f504f6dd385516ecd06dd208ad4ffd05f1b7a8169419e02dedf39832673
Contents?: true
Size: 616 Bytes
Versions: 33
Compression:
Stored size: 616 Bytes
Contents
module Expressive class Webhook def initialize(verb, url, params, headers) @verb, @url, @params, @headers = verb, url, params, headers end def execute self.send(@verb) end private def post headers = {:content_type => :json, :accept => :json} headers = headers.merge(@headers) if @headers RestClient.post(@url, @params.to_json, headers) end def get headers = {:params => @params} headers = headers.merge(@headers) if @headers RestClient.get(@url, headers) end def put RestClient.put(@url, @params) end end end
Version data entries
33 entries across 33 versions & 1 rubygems