Class: ROM::Mapper::Loader::Allocator

Inherits:
ROM::Mapper::Loader show all
Defined in:
lib/rom/mapper/loader/allocator.rb

Overview

Loader class which doesn’t call initialize

Direct Known Subclasses

AttributeWriter

Instance Method Summary collapse

Methods inherited from ROM::Mapper::Loader

#identity

Instance Method Details

#call(tuple) ⇒ 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.



13
14
15
16
17
18
19
# File 'lib/rom/mapper/loader/allocator.rb', line 13

def call(tuple)
  allocate { |attribute, object|
    object.instance_variable_set(
      "@#{attribute.name}", tuple[attribute.name]
    )
  }
end