Sha256: a5205e91b6aed35aff5745cf534664d46e12348d52803eec36d8f8690e3e2f0f

Contents?: true

Size: 767 Bytes

Versions: 18

Compression:

Stored size: 767 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 'registerable'
require_relative 'collection'
require_relative 'collections/all'
require_relative 'model'
require_relative 'repositories/all'
require_relative 'repository'

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
vedeu-0.4.47 lib/vedeu/repositories/all.rb
vedeu-0.4.46 lib/vedeu/repositories/all.rb
vedeu-0.4.45 lib/vedeu/repositories/all.rb
vedeu-0.4.44 lib/vedeu/repositories/all.rb
vedeu-0.4.43 lib/vedeu/repositories/all.rb
vedeu-0.4.42 lib/vedeu/repositories/all.rb
vedeu-0.4.41 lib/vedeu/repositories/all.rb
vedeu-0.4.40 lib/vedeu/repositories/all.rb
vedeu-0.4.39 lib/vedeu/repositories/all.rb
vedeu-0.4.38 lib/vedeu/repositories/all.rb
vedeu-0.4.37 lib/vedeu/repositories/all.rb
vedeu-0.4.36 lib/vedeu/repositories/all.rb
vedeu-0.4.35 lib/vedeu/repositories/all.rb
vedeu-0.4.34 lib/vedeu/repositories/all.rb
vedeu-0.4.33 lib/vedeu/repositories/all.rb
vedeu-0.4.32 lib/vedeu/repositories/all.rb
vedeu-0.4.31 lib/vedeu/repositories/all.rb
vedeu-0.4.30 lib/vedeu/repositories/all.rb