Class: IceNine::Freezer::Array

Inherits:
Object show all
Defined in:
lib/ice_nine/freezer/array.rb

Overview

A freezer class for handling Array objects

Direct Known Subclasses

Struct

Constant Summary

Constants inherited from IceNine::Freezer

BasicObject

Class Method Summary collapse

Methods inherited from IceNine::Freezer

[], const_lookup, deep_freeze, deep_freeze!

Class Method Details

.guarded_deep_freeze(array, recursion_guard) ⇒ Array

Deep Freeze an Array

Examples:

array = IceNine:Freezer::Array.deep_freeze(%w[a b c])
array.select(&:frozen?)  # => ['a', 'b', 'c']

Parameters:

Returns:


19
20
21
22
23
24
# File 'lib/ice_nine/freezer/array.rb', line 19

def self.guarded_deep_freeze(array, recursion_guard)
  super
  array.each do |entry|
    Freezer.guarded_deep_freeze(entry, recursion_guard)
  end
end