Module: ReevooMark

Defined in:
lib/reevoomark.rb,
lib/reevoomark/version.rb

Overview

Usage:

# Somewhere in you application config, build a client. $reevoomark_client = ReevooMark.create_client(

Rails.root.join("tmp/reevoo_cache"),
"http://mark.reevoo.com/reevoomark/embeddable_reviews.html"

)

# In your controller (assuming @entry.sku is your product SKU): # In your view: <%= @reevoo_reviews.body %>

Defined Under Namespace

Classes: Cache, Client, Document, Fetcher

Constant Summary collapse

VERSION =
"2.0.0"

Class Method Summary collapse

Class Method Details

.create_client(cache_dir, base_url, options = {}) ⇒ Object

Creates a new client.



29
30
31
32
33
# File 'lib/reevoomark.rb', line 29

def self.create_client(cache_dir, base_url, options = {})
  cache = ReevooMark::Cache.new(cache_dir)
  fetcher = ReevooMark::Fetcher.new(options[:timeout] || 1)
  ReevooMark::Client.new(cache, fetcher, base_url)
end

.new(cache_dir, url, trkref, sku) ⇒ Object

Legacy API. Creates a new client every time, so considered bad for business.



24
25
26
# File 'lib/reevoomark.rb', line 24

def self.new(cache_dir, url, trkref, sku)
  create_client(cache_dir, url).fetch(trkref, sku)
end