Sha256: dc697d512874be91469d07e8997a85990380bcf051f728dbc1d6ac64bb0521ec

Contents?: true

Size: 616 Bytes

Versions: 1

Compression:

Stored size: 616 Bytes

Contents

module Novel
  class Base
    attr_reader :logger, :repository

    REPOSITORIES = {
      memory: SagaRepository.new(adapter: RepositoryAdapters::Memory.new)
    }



    def initialize(logger:, repository:, timeout:, **args)
      @logger = logger
      @repository = repository.is_a?(Symbol) ? REPOSITORIES[repository] : repository
      raise InvalidRepositoryError.new("Repository '#{repository}' does not exist in Novel. Please, use custom object insted") unless @repository
      @timeout = timeout
    end

    def build(name:)
      WorkflowBuilder.new(name: name, repository: repository)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
novel-0.3.0 lib/novel/base.rb