Method: AsyncStorage::Allocator#initialize

Defined in:
lib/async_storage/allocator.rb

#initialize(repo, *args) ⇒ Allocator

Returns a new instance of Allocator.

Parameters:

  • repo (AsyncStorage::Repo)

    An instance of Repo

  • args (Array)

    An array with arguments to be fowarded to resolver#call



21
22
23
24
25
26
27
28
29
# File 'lib/async_storage/allocator.rb', line 21

def initialize(repo, *args)
  @repo = repo
  @args = args
  @naming = AsyncStorage::Naming.new(repo.resolver_class, *args)
  # It's different than the config.namespace.
  # Thinking about a directory structure.. The global namespace would be the root directory.
  # And the namespace under Repo level would be the subdirectory.
  @naming.prefix = repo.namespace if repo.namespace
end