Module: Shopkit

Extended by:
Configuration
Defined in:
lib/shopkit.rb,
lib/shopkit/client.rb,
lib/shopkit/request.rb,
lib/shopkit/version.rb,
lib/shopkit/traversal.rb,
lib/shopkit/connection.rb,
lib/shopkit/client/shop.rb,
lib/shopkit/client/orders.rb,
lib/shopkit/configuration.rb,
lib/shopkit/client/products.rb,
lib/shopkit/client/variants.rb,
lib/shopkit/client/webhooks.rb

Defined Under Namespace

Modules: Configuration, Connection, Request, Traversal Classes: Client

Constant Summary collapse

VERSION =
"0.1.6"

Constants included from Configuration

Configuration::DEFAULT_ADAPTER, Configuration::DEFAULT_API_VERSION, Configuration::DEFAULT_AUTO_TRAVERSAL, Configuration::DEFAULT_PER_PAGE, Configuration::DEFAULT_USER_AGENT, Configuration::VALID_OPTIONS_KEYS

Class Method Summary collapse

Methods included from Configuration

configure, extended, options, reset

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

Delegate to Shopkit::Client.new



20
21
22
23
# File 'lib/shopkit.rb', line 20

def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end

.new(options = {}) ⇒ Shopkit::Client

Returns:



10
11
12
13
14
15
16
# File 'lib/shopkit.rb', line 10

def new(options={})
  options['url'] = self.url
  options['access_token'] = self.access_token
  options['login'] = self.
  options['password'] = self.password
  Shopkit::Client.new(options)
end

.setup(options) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/shopkit.rb', line 25

def setup(options)
  self.url = options[:url]
  self.url = "http://#{self.url}" unless self.url.start_with?('http://', 'https://')
  self.access_token = options[:access_token]
  self. = options[:login] # or basic auth
  self.password = options[:password]
  options
end