Module: Google::Cloud::Firestore
- Defined in:
- lib/google/cloud/firestore.rb,
lib/google/cloud/firestore/batch.rb,
lib/google/cloud/firestore/query.rb,
lib/google/cloud/firestore/client.rb,
lib/google/cloud/firestore/convert.rb,
lib/google/cloud/firestore/service.rb,
lib/google/cloud/firestore/v1beta1.rb,
lib/google/cloud/firestore/version.rb,
lib/google/cloud/firestore/generate.rb,
lib/google/cloud/firestore/field_path.rb,
lib/google/cloud/firestore/credentials.rb,
lib/google/cloud/firestore/field_value.rb,
lib/google/cloud/firestore/transaction.rb,
lib/google/cloud/firestore/commit_response.rb,
lib/google/cloud/firestore/document_snapshot.rb,
lib/google/cloud/firestore/document_reference.rb,
lib/google/cloud/firestore/collection_reference.rb,
lib/google/cloud/firestore/v1beta1/doc/overview.rb,
lib/google/cloud/firestore/v1beta1/firestore_client.rb
Overview
Ruby Client for Google Cloud Firestore API (Beta)
Quick Start
In order to use this library, you first need to go through the following steps:
- Select or create a Cloud Platform project.
- Enable the Google Cloud Firestore API.
- Setup Authentication.
Installation
$ gem install google-cloud-firestore
Next Steps
- Read the Google Cloud Firestore API Product documentation to learn more about the product and see How-to Guides.
- View this repository's main README to see the full list of Cloud APIs that we cover.
Defined Under Namespace
Modules: V1beta1 Classes: Batch, Client, CollectionReference, CommitResponse, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Query, Transaction
Constant Summary collapse
- VERSION =
"0.20.0"
Class Method Summary collapse
-
.new(project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil, project: nil, keyfile: nil) ⇒ Google::Cloud::Firestore::Client
Creates a new object for connecting to the Firestore service.
Class Method Details
.new(project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil, project: nil, keyfile: nil) ⇒ Google::Cloud::Firestore::Client
Creates a new object for connecting to the Firestore service. Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/google/cloud/firestore.rb', line 495 def self.new project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil, project: nil, keyfile: nil project_id ||= (project || Firestore::Service.default_project_id) project_id = project_id.to_s # Always cast to a string fail ArgumentError, "project_id is missing" if project_id.empty? credentials ||= keyfile credentials ||= Firestore::Credentials.default(scope: scope) unless credentials.is_a? Google::Auth::Credentials credentials = Firestore::Credentials.new credentials, scope: scope end Firestore::Client.new \ Firestore::Service.new \ project_id, credentials, timeout: timeout, client_config: client_config end |