Sha256: ecd22713780a6f617d52bd8f6102c27ef715d602dede16b89ddb784564a2613b

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

# Logput
module Logput
  # Logging Adapters
  module Adapters
    # Base class from which all adapters inherit
    class Base
      # Initialize
      def initialize(logger)
        @logger = logger
      end

      # Registers a new adapter
      #
      # @param [Symbol] adapter The name of the adapter
      def self.register(adapter)
        raise "Already Registered :#{adapter}" if Logput::Adapters.registered_adapters[adapter]
        Logput::Adapters.registered_adapters[adapter] = self
      end

      # Placeholder for handles? method to be overridden when subclassed
      # @param [Class] _logger
      # @return [Boolean]
      def self.handles?(_logger)
        raise NotImplementedError
      end

      # Placeholder for path method to be overridden when subclassed
      # @return [String] path
      def path
        raise NotImplementedError
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logput-0.0.4 lib/logput/adapters/base.rb