Sha256: 68ba9758e86d9f3bd7ef35349942568c6e02f7b099db6728f48646b0d25ece26

Contents?: true

Size: 624 Bytes

Versions: 1

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

module JWT
  # Deprecations module to handle deprecation warnings in the gem
  module Deprecations
    class << self
      def warning(message)
        case JWT.configuration.deprecation_warnings
        when :warn
          warn("[DEPRECATION WARNING] #{message}")
        when :once
          return if record_warned(message)

          warn("[DEPRECATION WARNING] #{message}")
        end
      end

      private

      def record_warned(message)
        @warned ||= []
        return true if @warned.include?(message)

        @warned << message
        false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jwt-2.8.1 lib/jwt/deprecations.rb