Class: Google::Cloud::Firestore::AggregateQuerySnapshot
- Inherits:
-
Object
- Object
- Google::Cloud::Firestore::AggregateQuerySnapshot
- Defined in:
- lib/google/cloud/firestore/aggregate_query_snapshot.rb
Overview
AggregateQuerySnapshot
An aggregate query snapshot object is an immutable representation for an aggregate query result.
Instance Method Summary collapse
-
#get(aggregate_alias = nil) ⇒ Integer
Retrieves the aggregate data.
Instance Method Details
#get(aggregate_alias = nil) ⇒ Integer
Retrieves the aggregate data.
95 96 97 98 99 100 101 |
# File 'lib/google/cloud/firestore/aggregate_query_snapshot.rb', line 95 def get aggregate_alias = nil if @aggregate_fields.count > 1 && aggregate_alias.nil? raise ArgumentError, "Required param aggregate_alias for AggregateQuery with multiple aggregate fields" end aggregate_alias ||= @aggregate_fields.keys.first @aggregate_fields[aggregate_alias] end |