Class: ROM::Relation::Wrap
Overview
Relation wrapping other relations
Constant Summary
Constants included from Memoizable
Instance Attribute Summary
Attributes inherited from Graph
Attributes included from Memoizable
Instance Method Summary collapse
-
#call(*args) ⇒ Loaded
Materialize a wrap.
-
#relation ⇒ Object
abstract
private
Return an adapter-specific relation representing a wrap.
-
#wrap(*args) ⇒ Wrap
Wrap more relations.
-
#wrap? ⇒ true
private
Return if this is a wrap relation.
Methods inherited from Graph
#graph?, #map_to, #map_with, #mapper, #with_nodes
Methods included from Initializer
Methods included from Pipeline::Proxy
Methods included from Pipeline
Methods included from Pipeline::Operator
Methods included from Materializable
#each, #first, #one, #one!, #to_a
Methods included from Memoizable
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Pipeline::Proxy
Instance Method Details
#call(*args) ⇒ Loaded
Materialize a wrap
28 29 30 31 32 33 34 |
# File 'lib/rom/relation/wrap.rb', line 28 def call(*args) if auto_map? Loaded.new(self, mapper.(relation.with(auto_map: false, auto_struct: false))) else Loaded.new(self, relation.(*args)) end end |
#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.
This method is abstract.
Return an adapter-specific relation representing a wrap
41 42 43 |
# File 'lib/rom/relation/wrap.rb', line 41 def relation raise NotImplementedError end |
#wrap(*args) ⇒ Wrap
Wrap more relations
17 18 19 |
# File 'lib/rom/relation/wrap.rb', line 17 def wrap(*args) self.class.new(root, nodes + root.wrap(*args).nodes) end |
#wrap? ⇒ true
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.
Return if this is a wrap relation
50 51 52 |
# File 'lib/rom/relation/wrap.rb', line 50 def wrap? true end |