Sha256: 50d84b30523927a6fc36a834e131de21c37e95e9c1820ca4e159265f3d2130cc

Contents?: true

Size: 992 Bytes

Versions: 2

Compression:

Stored size: 992 Bytes

Contents

# encoding: utf-8

require 'set'

require 'ice_nine/support/recursion_guard'

require 'ice_nine/freezer'
require 'ice_nine/freezer/object'
require 'ice_nine/freezer/no_freeze'
require 'ice_nine/freezer/array'

require 'ice_nine/freezer/false_class'
require 'ice_nine/freezer/hash'
require 'ice_nine/freezer/hash/state'
require 'ice_nine/freezer/nil_class'
require 'ice_nine/freezer/numeric'
require 'ice_nine/freezer/range'
require 'ice_nine/freezer/rubinius'
require 'ice_nine/freezer/struct'
require 'ice_nine/freezer/symbol'
require 'ice_nine/freezer/true_class'

require 'ice_nine/version'

# Base IceNine module
module IceNine

  # Deep Freeze an object
  #
  # @example
  #   object = IceNine.deep_freeze(object)
  #
  # @param [Object] object
  #
  # @return [Object]
  #
  # @api public
  def self.deep_freeze(object)
    return object if object.frozen?
    RecursionGuard.guard(object.object_id) do
      Freezer[object.class].deep_freeze(object)
    end
  end

end # module IceNine

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ice_nine-0.7.0 lib/ice_nine.rb
ice_nine-0.6.0 lib/ice_nine.rb