gapic-common - Class Gapic::Rest::PagedEnumerable::Page (v0.24.0)

Reference documentation and code samples for the gapic-common class Gapic::Rest::PagedEnumerable::Page.

A class to represent a page in a PagedEnumerable. This also implements Enumerable, so it can iterate over the resource elements.

Inherits

  • Object

Includes

  • Enumerable

Methods

#each

def each() -> Enumerator

Iterate over the resources.

Yields
  • (Object) — Gives the resource objects in the page.
Returns
  • (Enumerator) — if no block is provided

#next_page_token

def next_page_token() -> String

The page token to be used for the next RPC call, or the empty string if there is no next page.

Returns
  • (String)

#next_page_token?

def next_page_token?() -> Boolean

Whether the next_page_token exists and is not empty

Returns
  • (Boolean)

#resources

def resources() -> Array

Resources in this page presented as an array. When the iterable is a protobuf map, the .each |item| gives just the keys to iterate like a normal hash it should be converted to an array first

Returns
  • (Array)

#response

def response() -> Object
Returns
  • (Object) — the response object for the page.