Class: Google::Cloud::Datastore::Dataset::AggregateQueryResults
- Inherits:
-
Object
- Object
- Google::Cloud::Datastore::Dataset::AggregateQueryResults
- Defined in:
- lib/google/cloud/datastore/dataset/aggregate_query_results.rb
Overview
AggregateQueryResults
An AggregateQueryResult object is a representation for a result of an AggregateQuery or a GqlQuery.
Instance Attribute Summary collapse
-
#read_time ⇒ Object
readonly
Read timestamp the query was done on the database at.
Instance Method Summary collapse
-
#get(aggregate_alias = nil) ⇒ Integer, ...
Retrieves the aggregate data.
Instance Attribute Details
#read_time ⇒ Object (readonly)
Read timestamp the query was done on the database at.
57 58 59 |
# File 'lib/google/cloud/datastore/dataset/aggregate_query_results.rb', line 57 def read_time @read_time end |
Instance Method Details
#get(aggregate_alias = nil) ⇒ Integer, ...
Retrieves the aggregate data.
if the aggregate_alias does not exist.
100 101 102 103 104 105 106 |
# File 'lib/google/cloud/datastore/dataset/aggregate_query_results.rb', line 100 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 |