Class: FeefoReviewFetcher
- Inherits:
-
Object
- Object
- FeefoReviewFetcher
- Defined in:
- app/models/feefo_review_fetcher.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#feefo_config ⇒ Object
readonly
Returns the value of attribute feefo_config.
Instance Method Summary collapse
- #fetch_reviews_json ⇒ Object
-
#initialize(code, feefo_config = Feefo.config) ⇒ FeefoReviewFetcher
constructor
A new instance of FeefoReviewFetcher.
Constructor Details
#initialize(code, feefo_config = Feefo.config) ⇒ FeefoReviewFetcher
Returns a new instance of FeefoReviewFetcher.
5 6 7 8 9 10 11 |
# File 'app/models/feefo_review_fetcher.rb', line 5 def initialize(code, feefo_config = Feefo.config) @code = code @feefo_config = feefo_config @redis = Redis.new(host: redis_config['host'], port: redis_config['port'], db: redis_config['db']) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'app/models/feefo_review_fetcher.rb', line 3 def code @code end |
#feefo_config ⇒ Object (readonly)
Returns the value of attribute feefo_config.
3 4 5 |
# File 'app/models/feefo_review_fetcher.rb', line 3 def feefo_config @feefo_config end |
Instance Method Details
#fetch_reviews_json ⇒ Object
13 14 15 16 17 |
# File 'app/models/feefo_review_fetcher.rb', line 13 def fetch_reviews_json with_caching do RemoteFeefoReviewFetcher.new(code, feefo_config).fetch_reviews end end |