Class: IceNine::Freezer::Range

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

Overview

A freezer class for handling Range objects

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(range, recursion_guard) ⇒ Range

Deep Freeze a Range

Examples:

range = IceNine:Freezer::Range.deep_freeze('a'..'z')
range.begin.frozen?  # => true
range.end.frozen?    # => true

Parameters:

Returns:



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

def self.guarded_deep_freeze(range, recursion_guard)
  super
  Freezer.guarded_deep_freeze(range.begin, recursion_guard)
  Freezer.guarded_deep_freeze(range.end, recursion_guard)
  range
end