class Contentful::SyncPage
Wrapper Class for Sync
results
Attributes
Public Class Methods
Source
# File lib/contentful/sync_page.rb, line 11 def initialize(item, configuration = { default_locale: Contentful::Client::DEFAULT_CONFIGURATION[:default_locale] }, *) super(item, configuration, true) @items = item.fetch('items', []) @next_sync_url = item.fetch('nextSyncUrl', nil) @next_page_url = item.fetch('nextPageUrl', nil) end
Calls superclass method
Contentful::BaseResource::new
Public Instance Methods
Source
# File lib/contentful/sync_page.rb, line 23 def inspect "<#{repr_name} next_sync_url='#{next_sync_url}' last_page=#{last_page?}>" end
@private
Source
# File lib/contentful/sync_page.rb, line 46 def last_page? !next_page_url end
Returns wether it is the last sync page
@return [Boolean]
Source
# File lib/contentful/sync_page.rb, line 30 def next_page sync.get(next_page_url) if next_page? end
Requests next sync page from API
@return [Contentful::SyncPage, void]
Source
# File lib/contentful/sync_page.rb, line 37 def next_page? # rubocop:disable Style/DoubleNegation !!next_page_url # rubocop:enable Style/DoubleNegation end
Returns wether there is a next sync page
@return [Boolean]