Method: Cloth::Client#initialize

Defined in:
lib/cloth/client.rb

#initialize(api_key = nil) ⇒ Client

Returns a new instance of Client.

Raises:



7
8
9
10
# File 'lib/cloth/client.rb', line 7

def initialize(api_key = nil)
  @api_key = api_key || Cloth.api_key
  raise Exception, "An API key must be set before the Cloth client can be used. Set an API key with 'Cloth.api_key = ...'" unless @api_key
end