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:) ⇒ Token

Returns a new instance of Token.

Parameters:

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


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

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

Instance Method Details

#can_continue?Boolean

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

Returns:

  • (Boolean)


24
25
26
# File 'lib/token.rb', line 24

def can_continue?
  !!@can_continue
end

#can_sync?Boolean

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

Returns:

  • (Boolean)


30
31
32
# File 'lib/token.rb', line 30

def can_sync?
  !!@can_sync
end