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