Sha256: 283e3a94cc6164ca78d6a334304f7fe9e14eeb04efc24dbf6de7eb490459cf9a

Contents?: true

Size: 1.61 KB

Versions: 6

Compression:

Stored size: 1.61 KB

Contents

# encoding: utf-8

require_relative '../request'
require_relative '../params_hash'

module Github
  # A class responsible for dispatching http requests
  class Request

    # Defines HTTP verbs
    module Verbs
      # Make a head request
      #
      # @api public
      def head_request(path, params = ParamsHash.empty)
        Request.new(:head, path, self).call(current_options, params)
      end

      # Make a get request
      #
      # @api public
      def get_request(path, params = ParamsHash.empty)
        request = Request.new(:get, path, self).call(current_options, params)
        request.auto_paginate
      end

      # Make a patch request
      #
      # @api public
      def patch_request(path, params = ParamsHash.empty)
        Request.new(:patch, path, self).call(current_options, params)
      end

      # Make a post request
      #
      # @api public
      def post_request(path, params = ParamsHash.empty)
        Request.new(:post, path, self).call(current_options, params)
      end

      # Make a put request
      #
      # @api public
      def put_request(path, params = ParamsHash.empty)
        Request.new(:put, path, self).call(current_options, params)
      end

      # Make a delete request
      #
      # @api public
      def delete_request(path, params = ParamsHash.empty)
        Request.new(:delete, path, self).call(current_options, params)
      end

      # Make a options request
      #
      # @api public
      def options_request(path, params = ParamsHash.empty)
        Request.new(:options, path, self).call(current_options, params)
      end
    end # Verbs
  end # Request
end # Github

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
github_api2-1.0.1 lib/github_api2/request/verbs.rb
github_api2-1.0.0 lib/github_api2/request/verbs.rb
github_api-0.19.0 lib/github_api/request/verbs.rb
lingfennan-github_api-0.18.2 lib/github_api/request/verbs.rb
github_api-0.18.2 lib/github_api/request/verbs.rb
github_api-0.18.1 lib/github_api/request/verbs.rb