Class: ROM::Relation::Composite
- Inherits:
-
Pipeline::Composite
- Object
- Pipeline::Composite
- ROM::Relation::Composite
- Includes:
- Materializable
- Defined in:
- lib/rom/relation/composite.rb
Overview
Left-to-right relation composition used for data-pipelining
Instance Attribute Summary
Attributes inherited from Pipeline::Composite
Instance Method Summary collapse
-
#call(*args) ⇒ Loaded
(also: #[])
Call the pipeline by passing results from left to right.
- #map_to(klass) ⇒ Object
Methods included from Materializable
#each, #first, #one, #one!, #to_a
Methods inherited from Pipeline::Composite
Methods included from Pipeline::Proxy
Constructor Details
This class inherits a constructor from ROM::Pipeline::Composite
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 Also known as: []
Call the pipeline by passing results from left to right
Optional args are passed to the left object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rom/relation/composite.rb', line 20 def call(*args) relation = left.call(*args) response = right.call(relation) if response.is_a?(Loaded) response else relation.new(response) end end |
#map_to(klass) ⇒ Object
35 36 37 |
# File 'lib/rom/relation/composite.rb', line 35 def map_to(klass) self >> left.map_to(klass).mapper end |