Sha256: ac90b35f8851b50d8bc25365182284d08ed7d339c0253070ddcd79b0d21814e1

Contents?: true

Size: 1.55 KB

Versions: 16

Compression:

Stored size: 1.55 KB

Contents

# encoding: utf-8

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

16 entries across 16 versions & 1 rubygems

Version Path
github_api-0.17.0 lib/github_api/request/verbs.rb
github_api-0.16.0 lib/github_api/request/verbs.rb
github_api-0.15.0 lib/github_api/request/verbs.rb
github_api-0.14.5 lib/github_api/request/verbs.rb
github_api-0.14.4 lib/github_api/request/verbs.rb
github_api-0.14.3 lib/github_api/request/verbs.rb
github_api-0.14.2 lib/github_api/request/verbs.rb
github_api-0.14.1 lib/github_api/request/verbs.rb
github_api-0.14.0 lib/github_api/request/verbs.rb
github_api-0.13.1 lib/github_api/request/verbs.rb
github_api-0.13.0 lib/github_api/request/verbs.rb
github_api-0.12.4 lib/github_api/request/verbs.rb
github_api-0.12.3 lib/github_api/request/verbs.rb
github_api-0.12.2 lib/github_api/request/verbs.rb
github_api-0.12.1 lib/github_api/request/verbs.rb
github_api-0.12.0 lib/github_api/request/verbs.rb