Class: Contentful::SyncPage

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::ArrayLike, Resource::SystemProperties
Defined in:
lib/contentful/sync_page.rb

Overview

Wrapper Class for Sync results

Instance Attribute Summary collapse

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #default_locale, #properties, #raw, #request

Instance Method Summary collapse

Methods included from Resource::ArrayLike

#array?, #each_item, #empty?, #size

Methods included from Resource

#array?, #fields, #localized?, #reload, #sys

Instance Attribute Details

#syncObject (readonly)

Returns the value of attribute sync.



7
8
9
# File 'lib/contentful/sync_page.rb', line 7

def sync
  @sync
end

Instance Method Details

#last_page?Boolean

Returns wether it is the last sync page

Returns:

  • (Boolean)


36
37
38
# File 'lib/contentful/sync_page.rb', line 36

def last_page?
  !next_page_url
end

#next_pageContentful::SyncPage, void

Requests next sync page from API

Returns:



20
21
22
# File 'lib/contentful/sync_page.rb', line 20

def next_page
  sync.get(next_page_url) if next_page?
end

#next_page?Boolean

Returns wether there is a next sync page

Returns:

  • (Boolean)


27
28
29
30
31
# File 'lib/contentful/sync_page.rb', line 27

def next_page?
  # rubocop:disable Style/DoubleNegation
  !!next_page_url
  # rubocop:enable Style/DoubleNegation
end