Module: Vedeu::Repositories::Model Private
- Included in:
- Borders::Border, Buffers::Buffer, Cursors::Cursor, Editor::Document, Events::Event, Geometries::Geometry, Groups::Group, Input::Keymap, Interfaces::Interface, Menus::Menu, Views::Composition, Views::Line, Views::Stream, Views::View
- Defined in:
- lib/vedeu/repositories/model.rb
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
-
.included(klass) ⇒ Class
private
Provide additional behaviour to a class or module.
Instance Method Summary collapse
-
#store(&block) ⇒ void
private
The model instance stored in the repository.
Instance Attribute Details
#repository ⇒ Vedeu::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.
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.
Perhaps some validation could be added here?
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 |