Sha256: b1acc86aed331018567019db026677c85bef79c94292387cba2a7e7c40d23473

Contents?: true

Size: 667 Bytes

Versions: 16

Compression:

Stored size: 667 Bytes

Contents

# frozen_string_literal: true

require 'cased/http/client'

module Cased
  class Clients
    def self.create(api_key:, url: nil, raise_on_errors: false)
      url ||= Cased.config.api_url

      Cased::HTTP::Client.new(url: url, api_key: api_key, raise_on_errors: raise_on_errors)
    end

    def organization
      @organization ||= self.class.create(api_key: ENV.fetch('CASED_ORGANIZATION_KEY'))
    end

    def publish
      @publish ||= self.class.create(url: Cased.config.publish_url, api_key: Cased.config.publish_key, raise_on_errors: true)
    end

    def cli
      @cli ||= self.class.create(api_key: Cased.config.guard_application_key)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cased-ruby-0.8.0 lib/cased/clients.rb
cased-ruby-0.7.1 lib/cased/clients.rb
cased-ruby-0.7.0 lib/cased/clients.rb
cased-ruby-0.6.1 lib/cased/clients.rb
cased-ruby-0.5.2 lib/cased/clients.rb
cased-ruby-0.5.1 lib/cased/clients.rb
cased-ruby-0.5.0 lib/cased/clients.rb
cased-ruby-0.4.8 lib/cased/clients.rb
cased-ruby-0.4.7 lib/cased/clients.rb
cased-ruby-0.4.6 lib/cased/clients.rb
cased-ruby-0.4.5 lib/cased/clients.rb
cased-ruby-0.4.4 lib/cased/clients.rb
cased-ruby-0.4.3 lib/cased/clients.rb
cased-ruby-0.4.2 lib/cased/clients.rb
cased-ruby-0.4.1 lib/cased/clients.rb
cased-ruby-0.4.0 lib/cased/clients.rb