Class: Google::Cloud::Datastore::Cursor
- Inherits:
-
Object
- Object
- Google::Cloud::Datastore::Cursor
- Defined in:
- lib/google/cloud/datastore/cursor.rb
Overview
# Cursor
Cursor is a point in query results. Cursors are returned in QueryResults.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(cursor) ⇒ Cursor
constructor
Base64 encoded array of bytes.
- #inspect ⇒ Object
- #to_grpc ⇒ Object
-
#to_s ⇒ Object
Base64 encoded array of bytes.
Constructor Details
#initialize(cursor) ⇒ Cursor
Base64 encoded array of bytes
38 39 40 |
# File 'lib/google/cloud/datastore/cursor.rb', line 38 def initialize cursor @cursor = cursor end |
Class Method Details
.from_grpc(grpc) ⇒ Object
70 71 72 73 74 |
# File 'lib/google/cloud/datastore/cursor.rb', line 70 def self.from_grpc grpc grpc = String grpc return nil if grpc.empty? new Core::GRPCUtils.encode_bytes(grpc) end |
Instance Method Details
#<=>(other) ⇒ Object
59 60 61 62 |
# File 'lib/google/cloud/datastore/cursor.rb', line 59 def <=> other return -1 unless other.is_a? Cursor @cursor <=> other.to_s end |
#==(other) ⇒ Object
53 54 55 56 |
# File 'lib/google/cloud/datastore/cursor.rb', line 53 def == other return false unless other.is_a? Cursor @cursor == other.to_s end |
#inspect ⇒ Object
48 49 50 |
# File 'lib/google/cloud/datastore/cursor.rb', line 48 def inspect "#{self.class}(#{@cursor})" end |
#to_grpc ⇒ Object
65 66 67 |
# File 'lib/google/cloud/datastore/cursor.rb', line 65 def to_grpc Core::GRPCUtils.decode_bytes(@cursor) end |
#to_s ⇒ Object
Base64 encoded array of bytes
43 44 45 |
# File 'lib/google/cloud/datastore/cursor.rb', line 43 def to_s @cursor end |