Sha256: 89dfc7fe1f42d4cb45193cc01486d2904409ff8e8a244893300d995478543e85

Contents?: true

Size: 430 Bytes

Versions: 6

Compression:

Stored size: 430 Bytes

Contents

module Labelary
  class Client
    def self.connection(*args)
      self.new(*args).connection
    end

    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

    private

    def config
      @config ||= Labelary.configuration
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
labelary-0.5.0 lib/labelary/client.rb
labelary-0.4.0 lib/labelary/client.rb
labelary-0.3.0 lib/labelary/client.rb
labelary-0.2.0 lib/labelary/client.rb
labelary-0.1.1 lib/labelary/client.rb
labelary-0.1.0 lib/labelary/client.rb