Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tenderlove/defrost
Never let pesky "frozen" objects get in your way again! Use Defrost to remove the frozen state from your objects!
https://github.com/tenderlove/defrost
cool frozen ruby
Last synced: about 2 months ago
JSON representation
Never let pesky "frozen" objects get in your way again! Use Defrost to remove the frozen state from your objects!
- Host: GitHub
- URL: https://github.com/tenderlove/defrost
- Owner: tenderlove
- License: apache-2.0
- Created: 2021-11-06T01:47:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-06T05:21:28.000Z (over 3 years ago)
- Last Synced: 2024-12-12T02:42:08.397Z (2 months ago)
- Topics: cool, frozen, ruby
- Language: Ruby
- Homepage:
- Size: 15.6 KB
- Stars: 42
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Defrost
Isn't it annoying when you try to mutate an object but it turns out the object
is frozen? Don't you wish you could "defrost" the object so you could mutate
it?Well I have the gem for you!
Never "lose your cool" with the Defrost gem! The Defrost gem allows you to
"unfreeze" your objects so that you can mutate them with reckless abandon! No
longer will you need to grapple with "immutability" when you can simply just
call "defrost".## Example
```ruby
# Frozen string. Boring, hard to use, can't change it
str = "some string".freeze
p str.frozen? # => truerequire "defrost"
# Not frozen string. Exciting, dynamic, no idea when it will change!
str.defrost
p str.frozen? # => false
```## Testimonials
"This is the most exciting thing to happen to my code since removing the GVL!" -- Aaron Patterson
"For a real treat, try mixing this gem with frozen string literals!" -- Aaron Patterson