0.0
No commit activity in last 3 years
No release in over 3 years
A deep, recursive freeze and freeze tester.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.0
>= 12.3.3
~> 5.0.2
>= 2.1.0
 Project Readme

FullyFreeze

This gem is created in recognition of two hot topics in Ruby programming.

Namely:

  • Multi-threaded programming with guilds.
  • Functional programming.

While these topics are outside the scope of this gem, both are facilitated by the concept of treating data as immutable, pure values.

While many data types in Ruby are immutable, many are not. Further, while the freeze method is provided to make data immutable, and the frozen? method can be used to determine if data is immutable, neither of these methods digs down into the interior of the object to make those data immutable as well.

The fully_freeze gem does not take such half measures. Instead it digs deep into the objects and gets the job done!

Installation

Add this line to your application's Gemfile:

gem 'fully_freeze'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fully_freeze

Usage

require 'fully_freeze'

Then when a deep freeze is needed use:

foo = my_object.fully_freeze

and to determine if that data is really immutable, use:

if my_object.fully_frozen?
  # etc etc etc...
end

And that is all there is too it!

Note: While this gem does employ monkey-patching, no existing methods are modified, so the risk level is low.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

OR...

  • Make a suggestion by raising an issue . All ideas and comments are welcome.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the fully_freeze project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.