# frozen_string_literal: true module CapitalOnTap class Configuration attr_accessor :client_id, :client_secret, :username, :password, :env attr_writer :debug AUTH_DOMAINS = { production: 'https://api-auth.capitalontap.com', development: 'https://prelive-api-auth.capitalontap.com' }.freeze API_DOMAINS = { production: 'https://api-partner.capitalontap.com', development: 'https://prelive-api-partner.capitalontap.com' }.freeze def initialize @client_id = '' @client_secret = '' @username = '' @password = '' @env = defined?(Rails) ? Rails.env : :development @debug = false end def debug? @debug end def base_auth_url AUTH_DOMAINS[@env.to_sym] || AUTH_DOMAINS[:development] end def base_url API_DOMAINS[@env.to_sym] || API_DOMAINS[:development] end end end