Sha256: 965626b6dd165fc067c1e2b34715bf476744b5e1839c5026e9acab6e16f2676d

Contents?: true

Size: 651 Bytes

Versions: 4

Compression:

Stored size: 651 Bytes

Contents

# frozen_string_literal: true

require 'async_storage/version'
require 'async_storage/config'
require 'async_storage/redis_pool'
require 'async_storage/json'
require 'async_storage/repo'
require 'async_storage/bath_actions'

module AsyncStorage
  class Error < StandardError; end
  class InvalidConfig < Error; end

  module_function

  def [](klass, **options)
    Repo.new(klass, **options)
  end

  def config
    @config ||= Config.new
  end

  def configure(&block)
    return unless block_given?

    config.instance_eval(&block)
    @redis_pool = nil
    config
  end

  def redis_pool
    @redis_pool ||= RedisPool.new(config.redis)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
async_storage-0.0.4 lib/async_storage.rb
async_storage-0.0.3 lib/async_storage.rb
async_storage-0.0.2 lib/async_storage.rb
async_storage-0.0.1 lib/async_storage.rb