Class: StatelyDB::Token

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

Overview

The Token type contains a continuation token for list and sync operations along with metadata about the ability to sync or continue listing based on the last operation performed.

Ths StatelyDB SDK vends this Token type for list and sync operations. Consumers should not need to construct this type directly.

Instance Method Summary collapse

Constructor Details

#initialize(token_data:, can_continue:, can_sync:, schema_version_id:) ⇒ Token

Returns a new instance of Token.

Parameters:

  • token_data (String)
  • can_continue (Boolean)
  • can_sync (Boolean)
  • schema_version_id (Integer)


17
18
19
20
21
22
# File 'lib/token.rb', line 17

def initialize(token_data:, can_continue:, can_sync:, schema_version_id:)
  @token_data = token_data
  @can_continue = can_continue
  @can_sync = can_sync
  @schema_version_id = schema_version_id
end

Instance Method Details

#can_continue?Boolean

Returns true if the list operation can be continued, otherwise false.

Returns:

  • (Boolean)


26
27
28
# File 'lib/token.rb', line 26

def can_continue?
  !!@can_continue
end

#can_sync?Boolean

Returns true if the sync operation can be continued, otherwise false.

Returns:

  • (Boolean)


32
33
34
# File 'lib/token.rb', line 32

def can_sync?
  !!@can_sync
end

#schema_version_idObject

Returns the schema version ID associated with the token.



37
38
39
# File 'lib/token.rb', line 37

def schema_version_id
  !!@schema_version_id
end