Class: Pupa::Processor::DocumentStore

Inherits:
Object
  • Object
show all
Defined in:
lib/pupa/processor/document_store.rb,
lib/pupa/processor/document_store/file_store.rb,
lib/pupa/processor/document_store/redis_store.rb

Overview

An JSON document store factory.

Heavily inspired by ActiveSupport::Cache::Store.

Defined Under Namespace

Classes: FileStore, RedisStore

Class Method Summary collapse

Class Method Details

.new(argument, **options) ⇒ Object

Returns a configured JSON document store.

See each document store for more information.

Parameters:

  • argument (String)

    the filesystem directory or Redis address (e.g. redis://localhost:6379/0) in which to dump JSON documents

  • options (Hash)

    optional arguments

Returns:

  • a configured JSON document store



18
19
20
21
22
23
24
# File 'lib/pupa/processor/document_store.rb', line 18

def self.new(argument, **options)
  if argument[%r{\Aredis://}]
    RedisStore.new(argument, options)
  else
    FileStore.new(argument)
  end
end