Sha256: 692e55d1bdcded03918cdc007323a71c75a28728da811b08236127978922e741

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

module Vedeu

  # Provides all registered repositories.
  #
  module Repositories

    extend self

    # @param klass [Class]
    # @return [Set]
    def register(klass)
      storage.add(klass)
    end

    # Remove all stored models from the repository.
    #
    # @return [TrueClass]
    def reset!
      storage.map(&:repository).map { |repository| repository.send(:reset) }

      true
    end

    private

    # Access to the storage for this repository.
    #
    # @return [Array]
    def storage
      @storage ||= Set.new
    end

  end # Repositories

end # Vedeu

require_relative 'store'
require_relative 'registerable'
require_relative 'collection'
require_relative 'collections/all'
require_relative 'model'
require_relative 'repositories/all'
require_relative 'repository'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.4.48 lib/vedeu/repositories/all.rb