ice_nine
Deep freeze ruby objects
Examples
# Freezes most objects
hash = IceNine.deep_freeze('a' => '1')
array = IceNine.deep_freeze([ 'a', 'b', 'c' ])
range = IceNine.deep_freeze('a'..'z')
struct = IceNine.deep_freeze(Struct.new(:a, :b).new('a', 'b'))
object = IceNine.deep_freeze(Object.new)
user = IceNine.deep_freeze(Application::User.new('dkubb'))
# Add core extension for Object#deep_freeze (not required by default)
require 'ice_nine/core_ext/object'
object = Object.new
object.deep_freeze
Installation
With Rubygems:
$ gem install ice_nine
$ irb -rubygems
>> require 'ice_nine'
=> true
With git and local working copy:
$ git clone git://github.com/dkubb/ice_nine.git
$ cd ice_nine
$ rake install
$ irb -rubygems
>> require 'ice_nine'
=> true
Contributing
See CONTRIBUTING.md for details.
Copyright
Copyright © 2012-2013 Dan Kubb. See LICENSE for details.