Class: ROM::Repository::RelationReader::Readers Private
- Inherits:
-
Module
- Object
- Module
- ROM::Repository::RelationReader::Readers
- Defined in:
- lib/rom/repository/relation_reader.rb
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.
Instance Attribute Summary collapse
- #cache ⇒ Object readonly private
Instance Method Summary collapse
- #define_readers(relations) ⇒ Object private
- #define_readers_for_relation(cache, name) ⇒ Object private
-
#initialize(relations) ⇒ Readers
constructor
private
A new instance of Readers.
Constructor Details
#initialize(relations) ⇒ Readers
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 Readers.
46 47 48 49 50 51 52 |
# File 'lib/rom/repository/relation_reader.rb', line 46 def initialize(relations) super() include InstanceMethods define_readers(relations) end |
Instance Attribute Details
#cache ⇒ Object (readonly)
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.
44 45 46 |
# File 'lib/rom/repository/relation_reader.rb', line 44 def cache @cache end |
Instance Method Details
#define_readers(relations) ⇒ 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.
55 56 57 58 59 60 |
# File 'lib/rom/repository/relation_reader.rb', line 55 def define_readers(relations) cache = Cache.new relations.each do |name| define_readers_for_relation(cache, name) end end |
#define_readers_for_relation(cache, 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.
63 64 65 66 67 |
# File 'lib/rom/repository/relation_reader.rb', line 63 def define_readers_for_relation(cache, name) define_method(name) do |**kwargs| relation_reader(cache, name, **kwargs) end end |