class Affilinet::Client

Constants

API_TYPE
API_VERSION
HOST
SERVICE

Attributes

connection[R]
options[R]
password[R]
publisher_id[R]
uri[R]

Public Class Methods

new(options={}) click to toggle source
# File lib/affilinet/client.rb, line 9
def initialize(options={})
  @options = {ssl: true, image_scales: [], logo_scales: [], shop_ids: [], category_ids: [], facets: []}
  @options.merge! options
  uri = @options[:ssl] ? 'https://' : 'http://'
  uri.concat HOST

  @uri = URI.join uri, API_VERSION, SERVICE, API_TYPE
  @publisher_id = @options[:publisher_id]
  @password = @options[:password]

  @connection = connection
end

Public Instance Methods

categories() click to toggle source
# File lib/affilinet/client.rb, line 37
def categories
  Affilinet::Category.new self
end
get(endpoint, args = {}) click to toggle source
# File lib/affilinet/client.rb, line 33
def get endpoint, args = {}
  connection.get(endpoint, args).body
end
products() click to toggle source
# File lib/affilinet/client.rb, line 45
def products
  Affilinet::Product.new self
end
properties() click to toggle source
# File lib/affilinet/client.rb, line 41
def properties
  Affilinet::Property.new self
end
shops() click to toggle source
# File lib/affilinet/client.rb, line 49
def shops
  Affilinet::Shop.new self
end