Project

mr_freeze

0.0
No commit activity in last 3 years
No release in over 3 years
Object#freeze! freezes the contents of arrays and hashes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

mr_freeze

Build Status

Real name: Dr Victor Fries

Description

Freeze arrays, hashes, and their contents

Example

gem install mr_freeze

# without mr_freeze
hash = {"some" => "hash"}.freeze
hash["some"].sub!(/h/, "b")

# => uh oh... we've changed the string in place

# load mr_freeze
require 'rubygems'
require 'mr_freeze'

# with mr_freeze
hash = {"victor" => "fries"}.freeze!
hash["victor"].sub!(/f/, "c")

# => TypeError: can't modify frozen string

License

mr_freeze is released under the MIT License.