Sha256: 029595aa0441aa7d663853c7ade31757360cae7e08f663b478e14df2d5d93ebe

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

module Basquiat
  module Adapters
    # Base implementation for an adapter
    module Base
      using Basquiat::HashRefinements

      def initialize
        @options = base_options
        @procs   = {}
        @retries = 0
      end

      # Used to set the options for the adapter. It is merged in
      # to the default_options hash.
      # @param [Hash] opts an adapter dependant hash of options
      def adapter_options(opts)
        @options.deep_merge(opts)
      end

      # Default options for the adapter
      # @return [Hash]
      def base_options
        default_options.merge(Basquiat.configuration.adapter_options)
      end

      def default_options
        {}
      end

      def update_config
      end

      def publish
      end

      def subscribe_to
      end

      def disconnect
      end

      def disconnected?
      end

      private

      attr_reader :procs, :options

      def logger
        Basquiat.configuration.logger
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
basquiat-1.1.1 lib/basquiat/adapters/base_adapter.rb