Sha256: 90045167ae84f9cefe64d339bb527c4e910c9faf0b479a1cc1a47aac0003fea3

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

require 'logger'
require 'uri'
require 'faraday'

# ToRemove
require 'openssl'
require 'cgi'

# Version
require 'fintecture/version'

# Modules
require 'fintecture/api/auth/authentication'

# Clients
require 'fintecture/pis_client'
require 'fintecture/ais_client'

# Utilities
require 'fintecture/utils/crypto'

# Endpoints
require 'fintecture/base_url'
require 'fintecture/endpoints/authentication'
require 'fintecture/endpoints/ais'
require 'fintecture/endpoints/pis'
require 'fintecture/endpoints/ressources'

# Connections
require 'fintecture/faraday/authentication/connection'

module Fintecture
  @log_level = nil
  @logger = nil

  class << self
    attr_accessor :logger
    attr_reader :log_level

    # Logging
    LEVEL_DEBUG = Logger::DEBUG
    LEVEL_ERROR = Logger::ERROR
    LEVEL_INFO = Logger::INFO

    def log_level=(val)
      case val
      when 'debug'
        val = LEVEL_DEBUG
      when 'info'
        val = LEVEL_INFO
      end

      if !val.nil? && ![LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO].include?(val)
        raise ArgumentError, 'log_level should only be set to `nil`, `debug` or `info`'
      end

      @log_level = val
    end
  end
end

Fintecture.log_level = ENV['FINTECTURE_LOG'] unless ENV['FINTECTURE_LOG'].nil?
# TODO: Mettre a jour la gem sur le site de package

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fintecture-0.5.1 lib/fintecture.rb
fintecture-0.5.0 lib/fintecture.rb
fintecture-0.4.1 lib/fintecture.rb
fintecture-0.3.1 lib/fintecture.rb
fintecture-0.3.0 lib/fintecture.rb