Retrieves remaining results by repeatedly invoking #next until
#next? returns false. Calls the given block once for each
result, which is passed as the argument to the block.
An Enumerator is returned if no block is given.
This method will make repeated API calls until all remaining results
are retrieved. (Unlike #each, for example, which merely iterates
over the results returned by a single API call.) Use with caution.
Parameter
request_limit (Integer) (defaults to: nil) — The upper limit of API requests to
make to load all models. Default is no limit.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# BigQuery API - Class Google::Cloud::Bigquery::Model::List (v1.56.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.56.0 (latest)](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Model-List)\n- [1.55.0](/ruby/docs/reference/google-cloud-bigquery/1.55.0/Google-Cloud-Bigquery-Model-List)\n- [1.54.0](/ruby/docs/reference/google-cloud-bigquery/1.54.0/Google-Cloud-Bigquery-Model-List)\n- [1.53.0](/ruby/docs/reference/google-cloud-bigquery/1.53.0/Google-Cloud-Bigquery-Model-List)\n- [1.52.1](/ruby/docs/reference/google-cloud-bigquery/1.52.1/Google-Cloud-Bigquery-Model-List)\n- [1.51.1](/ruby/docs/reference/google-cloud-bigquery/1.51.1/Google-Cloud-Bigquery-Model-List)\n- [1.50.0](/ruby/docs/reference/google-cloud-bigquery/1.50.0/Google-Cloud-Bigquery-Model-List)\n- [1.49.1](/ruby/docs/reference/google-cloud-bigquery/1.49.1/Google-Cloud-Bigquery-Model-List)\n- [1.48.1](/ruby/docs/reference/google-cloud-bigquery/1.48.1/Google-Cloud-Bigquery-Model-List)\n- [1.47.0](/ruby/docs/reference/google-cloud-bigquery/1.47.0/Google-Cloud-Bigquery-Model-List)\n- [1.46.1](/ruby/docs/reference/google-cloud-bigquery/1.46.1/Google-Cloud-Bigquery-Model-List)\n- [1.45.0](/ruby/docs/reference/google-cloud-bigquery/1.45.0/Google-Cloud-Bigquery-Model-List)\n- [1.44.2](/ruby/docs/reference/google-cloud-bigquery/1.44.2/Google-Cloud-Bigquery-Model-List)\n- [1.43.1](/ruby/docs/reference/google-cloud-bigquery/1.43.1/Google-Cloud-Bigquery-Model-List)\n- [1.42.0](/ruby/docs/reference/google-cloud-bigquery/1.42.0/Google-Cloud-Bigquery-Model-List)\n- [1.41.0](/ruby/docs/reference/google-cloud-bigquery/1.41.0/Google-Cloud-Bigquery-Model-List)\n- [1.40.0](/ruby/docs/reference/google-cloud-bigquery/1.40.0/Google-Cloud-Bigquery-Model-List)\n- [1.39.0](/ruby/docs/reference/google-cloud-bigquery/1.39.0/Google-Cloud-Bigquery-Model-List)\n- [1.38.1](/ruby/docs/reference/google-cloud-bigquery/1.38.1/Google-Cloud-Bigquery-Model-List) \nReference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Model::List.\n\nModel::List is a special case Array with additional values. \n\nInherits\n--------\n\n- Array\n\nMethods\n-------\n\n### #all\n\n def all(request_limit: nil, &block) { |model| ... } -\u003e Enumerator\n\nRetrieves remaining results by repeatedly invoking [#next](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Model-List#Google__Cloud__Bigquery__Model__List_next_instance_ \"Google::Cloud::Bigquery::Model::List#next (method)\") until\n[#next?](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Model-List#Google__Cloud__Bigquery__Model__List_next__instance_ \"Google::Cloud::Bigquery::Model::List#next? (method)\") returns `false`. Calls the given block once for each\nresult, which is passed as the argument to the block.\n\n\nAn Enumerator is returned if no block is given.\n\n\u003cbr /\u003e\n\nThis method will make repeated API calls until all remaining results\nare retrieved. (Unlike `#each`, for example, which merely iterates\nover the results returned by a single API call.) Use with caution. \n**Parameter**\n\n- **request_limit** (Integer) *(defaults to: nil)* --- The upper limit of API requests to make to load all models. Default is no limit. \n**Yields**\n\n- (model) --- The block for accessing each model. \n**Yield Parameter**\n\n- **model** ([Model](./Google-Cloud-Bigquery-Model)) --- The model object. \n**Returns**\n\n- (Enumerator)\n**Examples**\n\nIterating each result by passing a block: \n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\n\ndataset.models.all do |model|\n puts model.model_id\nend\n```\n\nUsing the enumerator by not passing a block: \n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\n\nall_names = dataset.models.all.map do |model|\n model.model_id\nend\n```\n\nLimit the number of API requests made: \n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\n\ndataset.models.all(request_limit: 10) do |model|\n puts model.model_id\nend\n```\n\n### #next\n\n def next() -\u003e Model::List\n\nRetrieve the next page of models. \n**Returns**\n\n- ([Model::List](./Google-Cloud-Bigquery-Model-List))\n**Example** \n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\n\nmodels = dataset.models\nif models.next?\n next_models = models.next\nend\n```\n\n### #next?\n\n def next?() -\u003e Boolean\n\nWhether there is a next page of models. \n**Returns**\n\n- (Boolean)\n**Example** \n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\n\nmodels = dataset.models\nif models.next?\n next_models = models.next\nend\n```\n\n### #token\n\n def token()\n\nIf not empty, indicates that there are more records that match\nthe request and this value should be passed to continue.\n\n### #token=\n\n def token=(value)\n\nIf not empty, indicates that there are more records that match\nthe request and this value should be passed to continue."]]