Class: PowerReviews::ReviewData::Summary
- Inherits:
-
Object
- Object
- PowerReviews::ReviewData::Summary
- Defined in:
- lib/power_reviews/review_data.rb
Instance Attribute Summary collapse
-
#average_rating ⇒ Object
readonly
Returns the value of attribute average_rating.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#reviews ⇒ Object
readonly
Returns the value of attribute reviews.
Instance Method Summary collapse
-
#initialize(element) ⇒ Summary
constructor
A new instance of Summary.
Constructor Details
#initialize(element) ⇒ Summary
Returns a new instance of Summary.
78 79 80 81 82 83 |
# File 'lib/power_reviews/review_data.rb', line 78 def initialize(element) @element = element @full_name = text_for_element('name') @average_rating = text_for_element('average_rating_decimal').to_s.to_f @reviews = text_for_element('fullreviews').to_s.to_i end |
Instance Attribute Details
#average_rating ⇒ Object (readonly)
Returns the value of attribute average_rating.
76 77 78 |
# File 'lib/power_reviews/review_data.rb', line 76 def @average_rating end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
76 77 78 |
# File 'lib/power_reviews/review_data.rb', line 76 def full_name @full_name end |
#reviews ⇒ Object (readonly)
Returns the value of attribute reviews.
76 77 78 |
# File 'lib/power_reviews/review_data.rb', line 76 def reviews @reviews end |