Class: Gcloud::Datastore::Cursor
- Inherits:
-
Object
- Object
- Gcloud::Datastore::Cursor
- Defined in:
- lib/gcloud/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
37 38 39 |
# File 'lib/gcloud/datastore/cursor.rb', line 37 def initialize cursor @cursor = cursor end |
Class Method Details
.from_grpc(grpc) ⇒ Object
69 70 71 72 73 |
# File 'lib/gcloud/datastore/cursor.rb', line 69 def self.from_grpc grpc grpc = String grpc return nil if grpc.empty? new GRPCUtils.encode_bytes(grpc) end |
Instance Method Details
#<=>(other) ⇒ Object
58 59 60 61 |
# File 'lib/gcloud/datastore/cursor.rb', line 58 def <=> other return -1 unless other.is_a? Cursor @cursor <=> other.to_s end |
#==(other) ⇒ Object
52 53 54 55 |
# File 'lib/gcloud/datastore/cursor.rb', line 52 def == other return false unless other.is_a? Cursor @cursor == other.to_s end |
#inspect ⇒ Object
47 48 49 |
# File 'lib/gcloud/datastore/cursor.rb', line 47 def inspect "#{self.class}(#{@cursor})" end |
#to_grpc ⇒ Object
64 65 66 |
# File 'lib/gcloud/datastore/cursor.rb', line 64 def to_grpc GRPCUtils.decode_bytes(@cursor) end |
#to_s ⇒ Object
Base64 encoded array of bytes
42 43 44 |
# File 'lib/gcloud/datastore/cursor.rb', line 42 def to_s @cursor end |