class ROM::Relation::Composite

Left-to-right relation composition used for data-pipelining

@api public

Public Instance Methods

[](*args)
Alias for: call
call(*args) click to toggle source

Call the pipeline by passing results from left to right

Optional args are passed to the left object

@return [Loaded]

@api public

# File lib/rom/relation/composite.rb, line 22
def call(*args)
  relation = left.call(*args)
  response = right.call(relation)

  if response.is_a?(Loaded)
    response
  else
    relation.new(response)
  end
end
Also aliased as: []
map_to(klass) click to toggle source

@see Relation#map_to

@api public

# File lib/rom/relation/composite.rb, line 37
def map_to(klass)
  self >> left.map_to(klass).mapper
end

Private Instance Methods

decorate?(response) click to toggle source

@api private

@see Pipeline::Proxy#decorate?

@api private

Calls superclass method ROM::Pipeline::Proxy#decorate?
# File lib/rom/relation/composite.rb, line 48
def decorate?(response)
  super || response.is_a?(Graph)
end