Module: SmartCore::ValueObject::Interface::Constructor::ImmutabilityControl Private

Defined in:
lib/smart_core/value_object/interface/constructor.rb

Overview

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.

Since:

  • 0.1.0

Class Method Summary collapse

Class Method Details

.freeze_instance(instance) ⇒ void

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.

Note:

strongly depends on SmartCore::Initializer implementation

This method returns an undefined value.

Parameters:

Since:

  • 0.1.0



70
71
72
# File 'lib/smart_core/value_object/interface/constructor.rb', line 70

def freeze_instance(instance)
  instance.freeze unless instance.frozen?
end

.to_procProc

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.

Note:

strongly depends on SmartCore::Initializer implementation

Returns:

  • (Proc)

Since:

  • 0.1.0



80
81
82
# File 'lib/smart_core/value_object/interface/constructor.rb', line 80

def to_proc
  proc { |instance| freeze_instance(instance) }
end