Class: ROM::Relation::Wrap

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

Overview

Relation wrapping other relations

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ROM::Pipeline::Proxy

Instance Attribute Details

#__memoized__Object (readonly) Originally defined in module Memoizable

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.

Instance Method Details

#call(*args) ⇒ Loaded

Materialize a wrap

Returns:

See Also:



30
31
32
33
34
35
36
# File 'lib/rom/relation/wrap.rb', line 30

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)


43
44
45
# File 'lib/rom/relation/wrap.rb', line 43

def relation
  raise NotImplementedError
end

#wrap(*args) ⇒ Wrap

Wrap more relations

Returns:

See Also:



19
20
21
# File 'lib/rom/relation/wrap.rb', line 19

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)


52
53
54
# File 'lib/rom/relation/wrap.rb', line 52

def wrap?
  true
end