Sha256: f6dc0c5f43f57c61533cfa04ceccafc67fb3d3b6ba36e58f34abd2d094abebb0

Contents?: true

Size: 630 Bytes

Versions: 2

Compression:

Stored size: 630 Bytes

Contents

module MidasClient
  module Util

    attr_accessor :logger

    def logger(progname = '[MIDAS_CLIENT]')
      @logger ||= Logger.new($stdout).tap do |log|
        log.progname = progname
      end
    end

    def log(text)
      logger.level = Logger::INFO
      logger.info "#{text}"
    end

    def error_log(text)
      logger.level = Logger::ERROR
      logger.error "#{text}"
    end

    def sanitized_document_number(number)
      number.gsub('.', '').gsub('-','') unless number.nil?
    end

    def sanitize_pci(text)
      CreditCardSanitizer.new(replacement_token: '@').sanitize!(text.to_s) || text
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
midas_client-0.2.14 lib/midas_client/util.rb
midas_client-0.2.13b lib/midas_client/util.rb