Sha256: a8aaa9389cdf731cec6915178115cbaa240cb4284cd6e2ebb1cb0e27c559a4a0

Contents?: true

Size: 468 Bytes

Versions: 19

Compression:

Stored size: 468 Bytes

Contents

# frozen_string_literal: true

class Configuration
  attr_accessor :client_id, :client_secret, :pix_key, :env

  def initialize
    @env           = ENV.fetch('BS2_ENVIRONMENT', 'sandbox')
    @client_id     = ENV.fetch('BS2_CLIENT_ID', nil)
    @client_secret = ENV.fetch('BS2_CLIENT_SECRET', nil)
  end

  def valid?
    raise Bs2Api::Errors::MissingConfiguration, 'Missing configuration credentials' if @client_id.blank? || @client_secret.blank?

    true
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bs2_api-1.4.1 lib/bs2_api/configuration.rb
bs2_api-1.4.0 lib/bs2_api/configuration.rb
bs2_api-1.2.2 lib/bs2_api/configuration.rb
bs2_api-1.2.1 lib/bs2_api/configuration.rb
bs2_api-1.2.0 lib/bs2_api/configuration.rb
bs2_api-1.1.7 lib/bs2_api/configuration.rb
bs2_api-1.1.6 lib/bs2_api/configuration.rb
bs2_api-1.1.5 lib/bs2_api/configuration.rb
bs2_api-1.1.4 lib/bs2_api/configuration.rb
bs2_api-1.1.3 lib/bs2_api/configuration.rb
bs2_api-1.1.2 lib/bs2_api/configuration.rb
bs2_api-1.1.1 lib/bs2_api/configuration.rb
bs2_api-1.1.0 lib/bs2_api/configuration.rb
bs2_api-1.0.3 lib/bs2_api/configuration.rb
bs2_api-1.0.2 lib/bs2_api/configuration.rb
bs2_api-1.0.1 lib/bs2_api/configuration.rb
bs2_api-1.0.0 lib/bs2_api/configuration.rb
bs2_api-0.4.0 lib/bs2_api/configuration.rb
bs2_api-0.3.4 lib/bs2_api/configuration.rb