Name Last Update
..
benchmarks Loading commit data...
config Loading commit data...
lib Loading commit data...
spec Loading commit data...
.gitignore Loading commit data...
.pelusa.yml Loading commit data...
.rspec Loading commit data...
.rubocop.yml Loading commit data...
.ruby-gemset Loading commit data...
.travis.yml Loading commit data...
.yardopts Loading commit data...
CONTRIBUTING.md Loading commit data...
Gemfile Loading commit data...
Gemfile.devtools Loading commit data...
Guardfile Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
Rakefile Loading commit data...
TODO Loading commit data...
ice_nine.gemspec Loading commit data...

README.md

ice_nine

Deep freeze ruby objects

Gem Version Build Status Dependency Status Code Climate Coverage Status Inline docs

Examples

require 'ice_nine'

# Deep freezes most kinds of 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(User.new(name: 'dkubb'))

# Faster deep freeze that skips deep-freezing frozen objects
object = IceNine.deep_freeze!(Object.new)

# Add core extension for Object#deep_freeze (not required by default)
require 'ice_nine'
require 'ice_nine/core_ext/object'

object = Object.new
object.deep_freeze

Contributing

See CONTRIBUTING.md for details.

Copyright © 2012-2014 Dan Kubb. See LICENSE for details.