Class: Labelary::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/labelary/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.connection(*args) ⇒ Object



3
4
5
# File 'lib/labelary/client.rb', line 3

def self.connection(*args)
  self.new(*args).connection
end

Instance Method Details

#connectionObject



7
8
9
10
11
12
13
14
# File 'lib/labelary/client.rb', line 7

def connection
  @connection ||= Faraday.new(url: config.url) do |faraday|
    faraday.request :multipart
    faraday.response :json, content_type: /\bjson$/

    faraday.adapter config.http_adapter
  end
end