Class: AppEngine::Datastore::Rating
- Inherits:
-
Object
- Object
- AppEngine::Datastore::Rating
- Defined in:
- lib/appengine-apis/datastore_types.rb
Overview
A user-provided integer rating for a piece of content. Normalized to a 0-100 scale.
Class Method Summary collapse
-
.new(rating) ⇒ Object
Raises ArgumentError if rating < 0 or rating > 100.
Instance Method Summary collapse
Class Method Details
.new(rating) ⇒ Object
Raises ArgumentError if rating < 0 or rating > 100.
179 180 181 182 183 184 185 |
# File 'lib/appengine-apis/datastore_types.rb', line 179 def self.new() if < MIN_VALUE || > MAX_VALUE raise ArgumentError, "rating must be no smaller than #{MIN_VALUE} " + "and no greater than #{MAX_VALUE} (received #{})" end super() end |
Instance Method Details
#inspect ⇒ Object
193 194 195 |
# File 'lib/appengine-apis/datastore_types.rb', line 193 def inspect "#<Rating #{}>" end |
#to_s ⇒ Object
189 190 191 |
# File 'lib/appengine-apis/datastore_types.rb', line 189 def to_s .to_s end |