Class: ActivityStreams::Object::Review
- Inherits:
-
ActivityStreams::Object
- Object
- Base
- ActivityStreams::Object
- ActivityStreams::Object::Review
- Defined in:
- lib/activitystreams/object/review.rb
Instance Method Summary collapse
Methods inherited from ActivityStreams::Object
#initialize, #recommended_verbs, recommended_verbs
Methods included from ExtProperties
Methods inherited from Base
Methods included from Validator
#to_float, #to_integer, #to_iri, #to_time, #validate_attribute!
Constructor Details
This class inherits a constructor from ActivityStreams::Object
Instance Method Details
#as_json ⇒ Object
10 11 12 13 14 |
# File 'lib/activitystreams/object/review.rb', line 10 def as_json hash = super hash[:rating] = hash.delete(:_rating_) hash end |
#validate_attributes! ⇒ Object
5 6 7 8 |
# File 'lib/activitystreams/object/review.rb', line 5 def validate_attributes! super to_float :_rating_, :precision => 1, :range => 1.0..5.0 end |