Class: Hanami::Model::MappedRelation Private
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Hanami::Model::MappedRelation
- Defined in:
- lib/hanami/model/mapped_relation.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Mapped proxy for ROM relations.
It eliminates the need of use #as for repository queries
Constant Summary collapse
- MAPPER_NAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Mapper name.
With ROM mapping there is a link between the entity class and a generic reference for it. Example:
BookRepositoryreferencesBookas:entity. :entity
Class Method Summary collapse
- .mapper_name ⇒ Object private
Instance Method Summary collapse
-
#initialize(relation) ⇒ MappedRelation
constructor
private
A new instance of MappedRelation.
Constructor Details
#initialize(relation) ⇒ MappedRelation
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.
Returns a new instance of MappedRelation.
28 29 30 |
# File 'lib/hanami/model/mapped_relation.rb', line 28 def initialize(relation) super(relation.as(self.class.mapper_name)) end |
Class Method Details
.mapper_name ⇒ Object
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.
22 23 24 |
# File 'lib/hanami/model/mapped_relation.rb', line 22 def self.mapper_name MAPPER_NAME end |