Class: FeefoReviews
- Inherits:
-
Object
- Object
- FeefoReviews
- Defined in:
- app/models/feefo_reviews.rb
Instance Attribute Summary collapse
-
#reviews ⇒ Object
readonly
Returns the value of attribute reviews.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Instance Method Summary collapse
- #average ⇒ Object
- #count ⇒ Object
-
#initialize(code) ⇒ FeefoReviews
constructor
A new instance of FeefoReviews.
Constructor Details
#initialize(code) ⇒ FeefoReviews
Returns a new instance of FeefoReviews.
4 5 6 7 8 9 10 |
# File 'app/models/feefo_reviews.rb', line 4 def initialize(code) data = fetch_reviews_json(code) return unless data @reviews = Array.wrap(data['FEEDBACKLIST']['FEEDBACK']) @summary = data['FEEDBACKLIST']['SUMMARY'] end |
Instance Attribute Details
#reviews ⇒ Object (readonly)
Returns the value of attribute reviews.
2 3 4 |
# File 'app/models/feefo_reviews.rb', line 2 def reviews @reviews end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
2 3 4 |
# File 'app/models/feefo_reviews.rb', line 2 def summary @summary end |
Instance Method Details
#average ⇒ Object
12 13 14 |
# File 'app/models/feefo_reviews.rb', line 12 def average @summary['AVERAGE'] end |
#count ⇒ Object
16 17 18 |
# File 'app/models/feefo_reviews.rb', line 16 def count @summary['COUNT'] end |