Class: Hanami::Model::Associations::Dsl Private
- Inherits:
-
Object
- Object
- Hanami::Model::Associations::Dsl
- Defined in:
- lib/hanami/model/associations/dsl.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.
Auto-infer relations linked to repository’s associations
Instance Method Summary collapse
- #belongs_to ⇒ Object private
- #has_many(relation) ⇒ Object private
-
#initialize(repository, &blk) ⇒ Dsl
constructor
private
A new instance of Dsl.
Constructor Details
#initialize(repository, &blk) ⇒ Dsl
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 Dsl.
11 12 13 14 |
# File 'lib/hanami/model/associations/dsl.rb', line 11 def initialize(repository, &blk) @repository = repository instance_eval(&blk) end |
Instance Method Details
#belongs_to ⇒ 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.
24 25 |
# File 'lib/hanami/model/associations/dsl.rb', line 24 def belongs_to(*) end |
#has_many(relation) ⇒ 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.
18 19 20 |
# File 'lib/hanami/model/associations/dsl.rb', line 18 def has_many(relation, *) @repository.__send__(:relations, relation) end |