Class: Contentstack::SyncResult

Inherits:
Object
  • Object
show all
Defined in:
lib/contentstack/sync_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sync_result) ⇒ SyncResult

Returns a new instance of SyncResult.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/contentstack/sync_result.rb', line 12

def initialize(sync_result)
  if sync_result.nil?
    @items = []
    @sync_token = nil
    @pagination_token = nil
    @total_count = 0
    @skip = 0
    @limit = 100
  else
    @items = sync_result["items"] || []
    @sync_token = sync_result["sync_token"] || nil
    @pagination_token = sync_result["pagination_token"] || nil
    @total_count = sync_result["total_count"] || 0
    @skip = sync_result["skip"] || 0
    @limit = sync_result["limit"] || 100
  end
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



5
6
7
# File 'lib/contentstack/sync_result.rb', line 5

def items
  @items
end

#limitObject (readonly)

Returns the value of attribute limit.



10
11
12
# File 'lib/contentstack/sync_result.rb', line 10

def limit
  @limit
end

#pagination_tokenObject (readonly)

Returns the value of attribute pagination_token.



7
8
9
# File 'lib/contentstack/sync_result.rb', line 7

def pagination_token
  @pagination_token
end

#skipObject (readonly)

Returns the value of attribute skip.



9
10
11
# File 'lib/contentstack/sync_result.rb', line 9

def skip
  @skip
end

#sync_tokenObject (readonly)

Returns the value of attribute sync_token.



6
7
8
# File 'lib/contentstack/sync_result.rb', line 6

def sync_token
  @sync_token
end

#total_countObject (readonly)

Returns the value of attribute total_count.



8
9
10
# File 'lib/contentstack/sync_result.rb', line 8

def total_count
  @total_count
end