Class: StatelyDB::SyncResult

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

Overview

SyncResult represents the results of a sync operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(changed_items:, deleted_item_paths:, updated_outside_list_window_paths:, is_reset:, token:) ⇒ SyncResult

Returns a new instance of SyncResult.

Parameters:

  • changed_items (Array<StatelyDB::Item>)

    the items that were changed

  • deleted_item_paths (Array<String>)

    the key paths that were deleted

  • updated_outside_list_window_paths (Array<String>)

    key paths for items that were updated but do not currently use the sort property that the list window is based on

  • is_reset (Boolean)

    whether the sync operation reset the token

  • token (StatelyDB::Token)

    the token to continue from



398
399
400
401
402
403
404
# File 'lib/statelydb.rb', line 398

def initialize(changed_items:, deleted_item_paths:, updated_outside_list_window_paths:, is_reset:, token:)
  @changed_items = changed_items
  @deleted_item_paths = deleted_item_paths
  @updated_outside_list_window_paths = updated_outside_list_window_paths
  @is_reset = is_reset
  @token = token
end

Instance Attribute Details

#changed_itemsArray<StatelyDB::Item> (readonly)

the items that were changed

Returns:



389
390
391
# File 'lib/statelydb.rb', line 389

def changed_items
  @changed_items
end

#deleted_item_pathsArray<String> (readonly)

the key paths that were deleted

Returns:

  • (Array<String>)

    the current value of deleted_item_paths



389
390
391
# File 'lib/statelydb.rb', line 389

def deleted_item_paths
  @deleted_item_paths
end

#is_resetBoolean (readonly)

whether the sync operation reset the token

Returns:

  • (Boolean)

    the current value of is_reset



389
390
391
# File 'lib/statelydb.rb', line 389

def is_reset
  @is_reset
end

#tokenStatelyDB::Token (readonly)

the token to continue from

Returns:



389
390
391
# File 'lib/statelydb.rb', line 389

def token
  @token
end

#updated_outside_list_window_pathsArray<String> (readonly)

the key paths of items that were updated but Stately cannot tell if they were in the sync window. Treat these as deleted in most cases.

Returns:

  • (Array<String>)

    the current value of updated_outside_list_window_paths



389
390
391
# File 'lib/statelydb.rb', line 389

def updated_outside_list_window_paths
  @updated_outside_list_window_paths
end