Sha256: 070bc0a2057a51932317cc8909a2c262eef268683e1d21f717f2d2fbfbef823e

Contents?: true

Size: 1.44 KB

Versions: 12

Compression:

Stored size: 1.44 KB

Contents

# encoding: utf-8

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/module'
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)
    Freezer.deep_freeze(object)
  end

  # Deep Freeze an object
  #
  # This method uses a faster algorithm that will assume objects that are
  # `frozen?` do not need to be frozen deeply. Use this method when `object`
  # contains no shallowly frozen objects that need deep freezing.
  #
  # @example
  #   IceNine.deep_freeze!(['a', 'b']).map(&:frozen?) # [true, true]
  #
  # @example
  #   IceNine.deep_freeze!(['a', 'b'].freeze).map(&:frozen?) # [false, false]
  #
  # @param [Object] object
  #
  # @return [Object]
  #
  # @api public
  def self.deep_freeze!(object)
    Freezer.deep_freeze!(object)
  end

end # IceNine

Version data entries

12 entries across 10 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/lib/ice_nine.rb
ice_nine-0.11.2 lib/ice_nine.rb
ice_nine-0.11.1 lib/ice_nine.rb
ice_nine-0.11.0 lib/ice_nine.rb