Sha256: f5b70b190df609156b92a3de692cb058f3115d58cb318f4c68b1d0337725d5bd

Contents?: true

Size: 469 Bytes

Versions: 10

Compression:

Stored size: 469 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

10 entries across 10 versions & 1 rubygems

Version Path
bs2_api-1.9.0 lib/bs2_api/configuration.rb
bs2_api-1.8.0 lib/bs2_api/configuration.rb
bs2_api-1.7.0 lib/bs2_api/configuration.rb
bs2_api-1.6.2 lib/bs2_api/configuration.rb
bs2_api-1.6.1 lib/bs2_api/configuration.rb
bs2_api-1.6.0 lib/bs2_api/configuration.rb
bs2_api-1.5.1 lib/bs2_api/configuration.rb
bs2_api-1.5.0 lib/bs2_api/configuration.rb
bs2_api-1.4.3 lib/bs2_api/configuration.rb
bs2_api-1.4.2 lib/bs2_api/configuration.rb