Class: IceNine::Freezer

Inherits:
Object
  • Object
show all
Defined in:
lib/ice_nine/freezer.rb,
lib/ice_nine/freezer/hash.rb,
lib/ice_nine/freezer/array.rb,
lib/ice_nine/freezer/range.rb,
lib/ice_nine/freezer/module.rb,
lib/ice_nine/freezer/struct.rb,
lib/ice_nine/freezer/symbol.rb,
lib/ice_nine/freezer/object.rb,
lib/ice_nine/freezer/numeric.rb,
lib/ice_nine/freezer/rubinius.rb,
lib/ice_nine/freezer/no_freeze.rb,
lib/ice_nine/freezer/nil_class.rb,
lib/ice_nine/freezer/true_class.rb,
lib/ice_nine/freezer/hash/state.rb,
lib/ice_nine/freezer/false_class.rb

Overview

The default class that handles freezing objects

Direct Known Subclasses

NoFreeze, Object

Defined Under Namespace

Classes: Array, FalseClass, Hash, Module, NilClass, NoFreeze, Numeric, Object, Range, Rubinius, Struct, Symbol, TrueClass

Constant Summary collapse

BasicObject =

Object

Object

Class Method Summary collapse

Class Method Details

.[](mod) ⇒ Class<Freezer>

Look up the Freezer descendant by object type

Examples:

freezer_class = IceNine::Freezer[mod]

Parameters:

Returns:


27
28
29
# File 'lib/ice_nine/freezer.rb', line 27

def self.[](mod)
  @freezer_cache[mod]
end

.deep_freeze(object) ⇒ Object

Deep freeze an object with a particular Freezer

Parameters:

Returns:

See Also:


40
41
42
# File 'lib/ice_nine/freezer.rb', line 40

def self.deep_freeze(object)
  guarded_deep_freeze(object, RecursionGuard::ObjectSet.new)
end

.deep_freeze!(object) ⇒ Object

Deep freeze an object with a particular Freezer

Parameters:

Returns:

See Also:


53
54
55
# File 'lib/ice_nine/freezer.rb', line 53

def self.deep_freeze!(object)
  guarded_deep_freeze(object, RecursionGuard::Frozen.new)
end