class Prestashop::Client::Implementation

Attributes

cache[R]
connection[R]

Public Class Methods

create(api_key, api_url) click to toggle source

Create new user implementation, keep it in current thread to allow multithearding, see #new

# File lib/prestashop/client/implementation.rb, line 20
def create api_key, api_url
  Thread.current[:prestashop_client] = new api_key, api_url
  current
end
current() click to toggle source

Get current client or raise exception, when client isn’t initialized

# File lib/prestashop/client/implementation.rb, line 27
def current
  Thread.current[:prestashop_client] ? Thread.current[:prestashop_client] : raise(UnitializedClient)
end
new(api_key, api_url) click to toggle source

Initialize new client see +Api::Connection#new+

# File lib/prestashop/client/implementation.rb, line 11
def initialize api_key, api_url
  @connection = Api::Connection.new api_key, api_url
  @cache = Cache.new
end