Module: Immutability::ClassMethods Private
- Defined in:
- lib/immutability.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.
Methods to be added to class, that included the ‘Immutability` module
Instance Method Summary collapse
-
#new(*args, &block) ⇒ Object
private
Reloads instance’s constructor to make it immutable.
Instance Method Details
#new(*args, &block) ⇒ 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.
Reloads instance’s constructor to make it immutable
86 87 88 89 |
# File 'lib/immutability.rb', line 86 def new(*args, &block) instance = allocate.tap { |obj| obj.__send__(:initialize, *args, &block) } IceNine.deep_freeze(instance) end |