Module: Shoplo

Defined in:
lib/shoplo.rb,
lib/shoplo/client.rb,
lib/shoplo/version.rb,
lib/shoplo/api/shop.rb,
lib/shoplo/api/order.rb,
lib/shoplo/api/product.rb,
lib/shoplo/api/customer.rb

Defined Under Namespace

Modules: API Classes: Client, HTTPUnauthorized, InvalidParams

Constant Summary collapse

VERSION =
'0.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyString

Returns the API key that is registered with Shoplo.

Returns:

  • (String)

    the API key that is registered with Shoplo



8
9
10
# File 'lib/shoplo.rb', line 8

def api_key
  @api_key
end

.secretString

Returns the secret that is registered with Shoplo.

Returns:

  • (String)

    the secret that is registered with Shoplo



12
13
14
# File 'lib/shoplo.rb', line 12

def secret
  @secret
end

Class Method Details

.client(access_token, token_secret) ⇒ Object



22
23
24
# File 'lib/shoplo.rb', line 22

def client(access_token, token_secret)
  @client ||= Shoplo::Client.new(access_token, token_secret)
end

.configure {|self| ... } ⇒ Object

Configuration interface of the gem

Yields:

  • (self)

    to accept configuration settings



17
18
19
20
# File 'lib/shoplo.rb', line 17

def configure
  yield self
  true
end

.respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Makes sure that the method missing is checked with the Shoplo::Client instance

Parameters:

  • method_name (String)

    the name of the method we want to run

  • include_private (Boolean) (defaults to: false)

    defines whether to check for private functions as well

Returns:

  • (Boolean)


31
32
33
# File 'lib/shoplo.rb', line 31

def respond_to_missing?(method_name, include_private=false)
  client.respond_to?(method_name, include_private)
end