Class: ROM::Relation::Graph
- Inherits:
-
Object
- Object
- ROM::Relation::Graph
- Extended by:
- Initializer
- Includes:
- Memoizable, Pipeline, Pipeline::Proxy, Materializable
- Defined in:
- lib/rom/relation/graph.rb
Overview
Abstract relation graph class
Constant Summary
Constants included from Memoizable
Instance Attribute Summary collapse
-
#nodes ⇒ Array<Relation>
(also: #right)
readonly
An array with relation nodes.
-
#root ⇒ Relation
(also: #left)
readonly
The root relation.
Attributes included from Memoizable
Instance Method Summary collapse
-
#graph? ⇒ true
private
Return if this is a graph relation.
-
#map_to(klass) ⇒ Graph
Map graph tuples to custom objects.
-
#map_with(*args) ⇒ Graph
Map graph tuples via custom mappers.
- #mapper ⇒ Object private
-
#with_nodes(nodes) ⇒ Graph
Rebuild a graph with new nodes.
Methods included from Initializer
Methods included from Pipeline::Proxy
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 Attribute Details
#nodes ⇒ Array<Relation> (readonly) Also known as: right
Returns An array with relation nodes.
27 |
# File 'lib/rom/relation/graph.rb', line 27 param :nodes |
#root ⇒ Relation (readonly) Also known as: left
Returns The root relation.
23 |
# File 'lib/rom/relation/graph.rb', line 23 param :root |
Instance Method Details
#graph? ⇒ 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 graph relation
54 55 56 |
# File 'lib/rom/relation/graph.rb', line 54 def graph? true end |
#map_to(klass) ⇒ Graph
Map graph tuples to custom objects
76 77 78 |
# File 'lib/rom/relation/graph.rb', line 76 def map_to(klass) self.class.new(root.map_to(klass), nodes) end |
#map_with(*args) ⇒ Graph
Map graph tuples via custom mappers
65 66 67 |
# File 'lib/rom/relation/graph.rb', line 65 def map_with(*args) self.class.new(root.map_with(*args), nodes) end |
#mapper ⇒ 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.
83 84 85 |
# File 'lib/rom/relation/graph.rb', line 83 def mapper mappers[to_ast] end |