Module: ROM::Initializer::InstanceMethods Private

Defined in:
lib/rom/initializer.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#freezeObject

This makes sure we memoize options before an object becomes frozen



70
71
72
73
# File 'lib/rom/initializer.rb', line 70

def freeze
  options
  super
end

#optionsHash

Instance options

Returns:

  • (Hash)


58
59
60
61
62
# File 'lib/rom/initializer.rb', line 58

def options
  @__options__ ||= self.class.dry_initializer.definitions.values.each_with_object({}) do |item, obj|
    obj[item.target] = instance_variable_get(item.ivar)
  end
end