Sha256: de452491fd915174207f334b49f5ab48de08224371a2f377bc87c34fcd0efbb0

Contents?: true

Size: 603 Bytes

Versions: 4

Compression:

Stored size: 603 Bytes

Contents

module Peakium
  class Webhook < APIResource
    include Peakium::APIOperations::Create
    include Peakium::APIOperations::Delete
    include Peakium::APIOperations::List

    def id
      unless id = self['url']
        raise InvalidRequestError.new("No url set for Peakium::Webhook")
      end
      id
    end

    def endpoint_url
      unless url = self['url']
        raise InvalidRequestError.new("Could not determine which endpoint URL to request: #{self.class} instance has invalid url: #{url.inspect}", 'url')
      end
      "#{self.class.endpoint_url}/#{CGI.escape(url)}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
peakium-0.1.4 lib/peakium/api_resources/webhook.rb
peakium-0.1.3 lib/peakium/api_resources/webhook.rb
peakium-0.1.2 lib/peakium/api_resources/webhook.rb
peakium-0.1.1 lib/peakium/api_resources/webhook.rb