Class: ROM::Relation::Wrap

Inherits:
Graph
  • Object
show all
Defined in:
lib/rom/relation/wrap.rb

Overview

Relation wrapping other relations

Constant Summary

Constants included from Memoizable

Memoizable::MEMOIZED_HASH

Instance Attribute Summary

Attributes inherited from Graph

#nodes, #root

Attributes included from Memoizable

#__memoized__

Instance Method Summary collapse

Methods inherited from Graph

#graph?, #map_to, #map_with, #mapper, #with_nodes

Methods included from Initializer

extended

Methods included from Pipeline::Proxy

#respond_to_missing?

Methods included from Pipeline

#map_with

Methods included from Pipeline::Operator

#>>

Methods included from Materializable

#each, #first, #one, #one!, #to_a

Methods included from Memoizable

included

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

Returns:

See Also:



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

#relationObject

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

Raises:

  • (NotImplementedError)


41
42
43
# File 'lib/rom/relation/wrap.rb', line 41

def relation
  raise NotImplementedError
end

#wrap(*args) ⇒ Wrap

Wrap more relations

Returns:

See Also:



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

Returns:

  • (true)


50
51
52
# File 'lib/rom/relation/wrap.rb', line 50

def wrap?
  true
end