Class: Contentful::Management::Array
- Inherits:
-
Object
- Object
- Contentful::Management::Array
- Includes:
- Resource, Resource::ArrayLike, Resource::SystemProperties
- Defined in:
- lib/contentful/management/array.rb
Overview
Resource Class for Arrays (e.g. search results) www.contentful.com/developers/documentation/content-delivery-api/#arrays It also provides an #each method and includes Ruby’s Enumerable module (gives you methods like #min, #first, etc)
Constant Summary collapse
- DEFAULT_LIMIT =
100
Constants included from Resource::SystemProperties
Resource::SystemProperties::SYS_COERCIONS
Constants included from Resource
Instance Attribute Summary
Attributes included from Resource::SystemProperties
Attributes included from Resource
#client, #default_locale, #properties, #request
Instance Method Summary collapse
-
#next_page ⇒ Object
Simplifies pagination.
Methods included from Resource::ArrayLike
#array?, #each_item, #empty?, #size
Methods included from Resource::SystemProperties
included, #initialize, #inspect
Methods included from Resource
#array?, #fields, #initialize, #inspect, #nested_locale_fields?, #sys
Instance Method Details
#next_page ⇒ Object
Simplifies pagination
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/contentful/management/array.rb', line 23 def next_page if request new_skip = (skip || 0) + (limit || DEFAULT_LIMIT) new_request = request.copy new_request.query[:skip] = new_skip response = new_request.get result = ResourceBuilder.new(response, {}, {}) result.run else false end end |