Sha256: 58d16c6d0d70a1be5f8aac58fc9dfcb087ee5957e0b972f32d9ab8afda1e23d2

Contents?: true

Size: 731 Bytes

Versions: 5

Compression:

Stored size: 731 Bytes

Contents

module Pupa
  class Processor
    # An JSON document store factory.
    #
    # Heavily inspired by `ActiveSupport::Cache::Store`.
    class DocumentStore
      # Returns a configured JSON document store.
      #
      # See each document store for more information.
      #
      # @param [String] argument the filesystem directory or Redis address
      #   (e.g. `redis://localhost:6379/0`) in which to dump JSON documents
      # @param [Hash] options optional arguments
      # @return a configured JSON document store
      def self.new(argument, **options)
        if argument[%r{\Aredis://}]
          RedisStore.new(argument, options)
        else
          FileStore.new(argument)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pupa-0.0.13 lib/pupa/processor/document_store.rb
pupa-0.0.12 lib/pupa/processor/document_store.rb
pupa-0.0.11 lib/pupa/processor/document_store.rb
pupa-0.0.10 lib/pupa/processor/document_store.rb
pupa-0.0.9 lib/pupa/processor/document_store.rb