Sha256: d1f663ad1384c12c8ee2c63c170d57b5ca761aaf05db4ecafd7168eabb6dbb0c

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

# frozen_string_literal: true

module Bugscriber
  module Resources
    class BaseResource
      attr_reader :client

      def initialize(client)
        @client = client
      end

      private

      def get_request(url, params: {}, headers: {})
        client.connection.get(url, params, headers)
      end

      def post_request(url, body:, headers: {})
        client.connection.post(url, body, headers)
      end

      def patch_request(url, body:, headers: {})
        client.connection.patch(url, body, headers)
      end

      def put_request(url, body:, headers: {})
        client.connection.put(url, body, headers)
      end

      def delete_request(url, params: {}, headers: {})
        client.connection.delete(url, params, headers)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bugscriber-0.1.0 lib/bugscriber/resources/base_resource.rb