Class: StatelyDB::Token
- Inherits:
-
Object
- Object
- StatelyDB::Token
- 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
-
#can_continue? ⇒ Boolean
Returns true if the list operation can be continued, otherwise false.
-
#can_sync? ⇒ Boolean
Returns true if the sync operation can be continued, otherwise false.
-
#initialize(token_data:, can_continue:, can_sync:, schema_version_id:) ⇒ Token
constructor
A new instance of Token.
-
#schema_version_id ⇒ Object
Returns the schema version ID associated with the token.
Constructor Details
#initialize(token_data:, can_continue:, can_sync:, schema_version_id:) ⇒ Token
Returns a new instance of Token.
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.
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.
32 33 34 |
# File 'lib/token.rb', line 32 def can_sync? !!@can_sync end |
#schema_version_id ⇒ Object
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 |