Movatterモバイル変換


[0]ホーム

URL:


Libraries »piotrmurach/github(master) »Index (P) »Github »PagedRequest

Module: Github::PagedRequest

Includes:
Constants
Included in:
PageIterator
Defined in:
lib/github_api/paged_request.rb

Overview

A module that adds http get request to response pagination

Constant Summarycollapse

FIRST_PAGE =

Default request page if none provided

1
PER_PAGE =

Default number of items as specified by API

30
NOT_FOUND =

Either page or per_page parameter not present

-1# Either page or per_page parameter not present

Constants included fromConstants

Constants::ACCEPT,Constants::ACCEPTED_OAUTH_SCOPES,Constants::ACCEPT_CHARSET,Constants::CACHE_CONTROL,Constants::CONTENT_LENGTH,Constants::CONTENT_TYPE,Constants::DATE,Constants::ETAG,Constants::HEADER_LAST,Constants::HEADER_LINK,Constants::HEADER_NEXT,Constants::LOCATION,Constants::META_FIRST,Constants::META_LAST,Constants::META_NEXT,Constants::META_PREV,Constants::META_REL,Constants::OAUTH_SCOPES,Constants::PARAM_PAGE,Constants::PARAM_PER_PAGE,Constants::PARAM_START_PAGE,Constants::RATELIMIT_LIMIT,Constants::RATELIMIT_REMAINING,Constants::RATELIMIT_RESET,Constants::SERVER,Constants::USER_AGENT

Instance Method Summarycollapse

Instance Method Details

#default_pageObject

242526
# File 'lib/github_api/paged_request.rb', line 24defdefault_pagecurrent_api.page?current_api.page:FIRST_PAGEend

#default_page_sizeObject

Check if current api instance has default per_page param set, otherwise use global default.

202122
# File 'lib/github_api/paged_request.rb', line 20defdefault_page_sizecurrent_api.per_page?current_api.per_page:PER_PAGEend

#page_request(path, params = {}) ⇒Object

Perform http get request with pagination parameters

30313233343536373839
# File 'lib/github_api/paged_request.rb', line 30defpage_request(path,params={})ifparams[PARAM_PER_PAGE]==NOT_FOUNDparams[PARAM_PER_PAGE]=default_page_sizeendifparams[PARAM_PAGE]&&params[PARAM_PAGE]==NOT_FOUNDparams[PARAM_PAGE]=default_pageendcurrent_api.get_request(path,ParamsHash.new(params))end
Generated on Sun Nov 30 01:54:43 2025 byyard 0.9.37 (ruby-3.4.3).

[8]ページ先頭

©2009-2025 Movatter.jp