Module: Vedeu::Repositories::Model Private

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

When included into a class, provides the mechanism to store the class in a repository for later retrieval.

Defined Under Namespace

Modules: SingletonMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#repositoryVedeu::Repositories::Repository



16
17
18
# File 'lib/vedeu/repositories/model.rb', line 16

def repository
  @repository
end

Class Method Details

.included(klass) ⇒ Class

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Provide additional behaviour to a class or module.

Parameters:

  • klass (Class)

Returns:

  • (Class)

    Returns the klass parameter.



67
68
69
# File 'lib/vedeu/repositories/model.rb', line 67

def self.included(klass)
  klass.extend(Vedeu::Repositories::Model::SingletonMethods)
end

Instance Method Details

#store(&block) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

TODO:

Perhaps some validation could be added here?

Note:

If a block is given, store the model, return the model after yielding.

This method returns an undefined value.

Returns The model instance stored in the repository.



75
76
77
# File 'lib/vedeu/repositories/model.rb', line 75

def store(&block)
  repository.store(self, &block)
end