Class: Google::Cloud::Firestore::FieldPath
- Inherits:
-
Object
- Object
- Google::Cloud::Firestore::FieldPath
- Includes:
- Comparable
- Defined in:
- lib/google/cloud/firestore/field_path.rb
Overview
FieldPath
Represents a field path to the Firestore API. See Client#field_path.
Class Method Summary collapse
-
.document_id ⇒ FieldPath
Creates a field path object representing the sentinel ID of a document.
Instance Method Summary collapse
-
#initialize(*fields) ⇒ FieldPath
constructor
Creates a field path object representing a nested field for document data.
Constructor Details
#initialize(*fields) ⇒ FieldPath
Creates a field path object representing a nested field for document data.
59 60 61 62 63 64 |
# File 'lib/google/cloud/firestore/field_path.rb', line 59 def initialize *fields @fields = fields.flatten.map(&:to_s) @fields.each do |field| fail ArgumentError, "empty paths not allowed" if field.empty? end end |
Class Method Details
.document_id ⇒ FieldPath
Creates a field path object representing the sentinel ID of a document. It can be used in queries to sort or filter by the document ID. See Client#document_id.
136 137 138 |
# File 'lib/google/cloud/firestore/field_path.rb', line 136 def self.document_id new :__name__ end |