Class: FeefoReviewFetcher

Inherits:
Object
  • Object
show all
Defined in:
app/models/feefo_review_fetcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'app/models/feefo_review_fetcher.rb', line 3

def code
  @code
end

#feefo_configObject (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_jsonObject



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