Sha256: 1643a89a929660234a5079b6b19d6c94a58c53313f756f8b8d0238839b1e89d7

Contents?: true

Size: 651 Bytes

Versions: 12

Compression:

Stored size: 651 Bytes

Contents

# encoding: utf-8

module IceNine
  class Freezer

    # A freezer class for handling Array objects
    class Array < Object

      # Deep Freeze an Array
      #
      # @example
      #   array = IceNine:Freezer::Array.deep_freeze(%w[a b c])
      #   array.select(&:frozen?)  # => ['a', 'b', 'c']
      #
      # @param [Array] array
      # @param [RecursionGuard] recursion_guard
      #
      # @return [Array]
      def self.guarded_deep_freeze(array, recursion_guard)
        super
        array.each do |entry|
          Freezer.guarded_deep_freeze(entry, recursion_guard)
        end
      end

    end # Array
  end # Freezer
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/freezer/array.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/lib/ice_nine/freezer/array.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/lib/ice_nine/freezer/array.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/ice_nine-0.11.2/lib/ice_nine/freezer/array.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/ice_nine-0.11.2/lib/ice_nine/freezer/array.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/lib/ice_nine/freezer/array.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/freezer/array.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/lib/ice_nine/freezer/array.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/freezer/array.rb
ice_nine-0.11.2 lib/ice_nine/freezer/array.rb
ice_nine-0.11.1 lib/ice_nine/freezer/array.rb
ice_nine-0.11.0 lib/ice_nine/freezer/array.rb