Class: AppStore::UserReview
Overview
Each Application can have multiple user reviews. Available attributes:
-
average_user_rating: rating given by the user for the application. -
user_name: name of the user who made the rating. -
title: title of the rating (probably some internal apple stuff). -
text: comment leaved by the user.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#clean_title ⇒ Object
title extracted from title without position and version.
-
#clean_user_name ⇒ Object
user_name without date.
-
#date ⇒ Object
date of the comment, extracted from user_name.
-
#on_version ⇒ Object
version on which the comment was made.
-
#position ⇒ Object
display position of the user review.
Methods inherited from Base
Methods included from Helper::Plist
Constructor Details
This class inherits a constructor from AppStore::Base
Instance Method Details
#clean_title ⇒ Object
title extracted from title without position and version
29 30 31 |
# File 'lib/app_store/user_review.rb', line 29 def clean_title title.match(/^[0-9]+\. (.*) \(v.*\)$/)[1] end |
#clean_user_name ⇒ Object
user_name without date
39 40 41 |
# File 'lib/app_store/user_review.rb', line 39 def clean_user_name user_name.match(/^(.*) on [a-zA-Z]{3} [0-9]{1,2}, [0-9]{4}$/)[1] end |
#date ⇒ Object
date of the comment, extracted from user_name
34 35 36 |
# File 'lib/app_store/user_review.rb', line 34 def date Time.parse user_name.match(/ on ([a-zA-Z]{3} [0-9]{1,2}, [0-9]{4})$/)[1] end |
#on_version ⇒ Object
version on which the comment was made
19 20 21 |
# File 'lib/app_store/user_review.rb', line 19 def on_version @on_version ||= title.match(/.*\(v(.*)\)$/)[1] end |
#position ⇒ Object
display position of the user review
24 25 26 |
# File 'lib/app_store/user_review.rb', line 24 def position @position ||= title.match(/^([0-9]+)\..*/)[1] end |