Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRating
- Inherits:
-
Object
- Object
- Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRating
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/retail_v2beta/classes.rb,
lib/google/apis/retail_v2beta/representations.rb,
lib/google/apis/retail_v2beta/representations.rb
Overview
The rating of a Product.
Instance Attribute Summary collapse
-
#average_rating ⇒ Float
The average rating of the Product.
-
#rating_count ⇒ Fixnum
The total number of ratings.
-
#rating_histogram ⇒ Array<Fixnum>
List of rating counts per rating value (index = rating - 1).
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRetailV2betaRating
constructor
A new instance of GoogleCloudRetailV2betaRating.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRetailV2betaRating
Returns a new instance of GoogleCloudRetailV2betaRating.
6151 6152 6153 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6151 def initialize(**args) update!(**args) end |
Instance Attribute Details
#average_rating ⇒ Float
The average rating of the Product. The rating is scaled at 1-5. Otherwise, an
INVALID_ARGUMENT error is returned.
Corresponds to the JSON property averageRating
6133 6134 6135 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6133 def @average_rating end |
#rating_count ⇒ Fixnum
The total number of ratings. This value is independent of the value of
rating_histogram. This value must be nonnegative. Otherwise, an
INVALID_ARGUMENT error is returned.
Corresponds to the JSON property ratingCount
6140 6141 6142 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6140 def @rating_count end |
#rating_histogram ⇒ Array<Fixnum>
List of rating counts per rating value (index = rating - 1). The list is empty
if there is no rating. If the list is non-empty, its size is always 5.
Otherwise, an INVALID_ARGUMENT error is returned. For example, [41, 14, 13, 47,
303]. It means that the Product got 41 ratings with 1 star, 14 ratings with 2
star, and so on.
Corresponds to the JSON property ratingHistogram
6149 6150 6151 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6149 def @rating_histogram end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
6156 6157 6158 6159 6160 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6156 def update!(**args) @average_rating = args[:average_rating] if args.key?(:average_rating) @rating_count = args[:rating_count] if args.key?(:rating_count) @rating_histogram = args[:rating_histogram] if args.key?(:rating_histogram) end |