Module: Mutability
- Defined in:
- lib/mutability/mutable.rb,
lib/mutability.rb,
lib/mutability/version.rb,
lib/mutability/mutable_hash.rb,
lib/mutability/mutable_array.rb
Overview
************************************************************************** Mutability::Mutable
This class adds a wrapper around a an object that keeps an unchanged
copy of the object. This allows it to be mutated as much as needed and
still be compared against the original version, or even reset to the
original.
Adds the freeze! and revert! methods and delegates most methods to the
working version (@self). The following methods act upon the Mutable
object itself and not its working version:
- #inspect
- #=
- any equality methods that are not built on #== or #===
**************************************************************************
Defined Under Namespace
Classes: Mutable, MutableArray, MutableHash
Constant Summary collapse
- DELEGATED_METHODS =
%i(to_s == === is_a? kind_of?)
- VERSION =
'1.0.1'