Sha256: 8da5ef6a192d32fa29094edcd8eb3b6fe74a2a5c523944ae10d8f99ef2570ce9

Contents?: true

Size: 714 Bytes

Versions: 5

Compression:

Stored size: 714 Bytes

Contents

# encoding: utf-8

module Nimbu
  module Endpoints
    class Webhooks < Endpoint
      def list(*args)
        arguments(args)

        response = get_request("/webhooks", arguments.params)
        return response unless block_given?
        response.each { |el| yield el }
      end
      alias :all :list

      def get(*args)
        arguments(args, :required => [:webhook_id])

        get_request("/webhooks/#{webhook_id}", arguments.params)
      end
      alias :find :get

      def delete(*args)
        arguments(args, :required => [:webhook_id])

        delete_request("/webhooks/#{webhook_id}", arguments.params)
      end
      alias :remove :delete

    end # Webhooks
  end # Endpoints
end # Nimbu

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nimbu-api-0.4.4 lib/nimbu-api/endpoints/webhooks.rb
nimbu-api-0.4.3 lib/nimbu-api/endpoints/webhooks.rb
nimbu-api-0.4.2 lib/nimbu-api/endpoints/webhooks.rb
nimbu-api-0.4.1 lib/nimbu-api/endpoints/webhooks.rb
nimbu-api-0.4.0 lib/nimbu-api/endpoints/webhooks.rb