We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze does not work:
> r = RecursiveOpenStruct.new( { hello: 'world', foo: [ {bar: :baz} ] }, recurse_over_arrays: true) > r.freeze > r.delete_field('foo') > r => #<RecursiveOpenStruct hello="world"> > r.bar = 'baz' > r => #<RecursiveOpenStruct hello="world", bar="baz">
Deep freeze would be nice:
> r = RecursiveOpenStruct.new( { hello: 'world', foo: [ {bar: :baz} ] }, recurse_over_arrays: true) > r.deep_freeze > r.hello.reverse! FrozenError (can't modify frozen String) > r.foo << { dog: :cat } FrozenError (can't modify frozen Array) > r.foo.first.bar = :closed FrozenError (can't modify frozen RecursiveOpenStruct)
This could be done after initialization if immutable: true has been given:
immutable: true
> r = RecursiveOpenStruct.new( { hello: 'world', foo: [ {bar: :baz} ] }, recurse_over_arrays: true, immutable: true) > r.hello = 'universe' FrozenError (can't modify frozen RecursiveOpenStruct) > r.foo << { dog: :cat } FrozenError (can't modify frozen Array) > r.foo.first.bar = :closed FrozenError (can't modify frozen RecursiveOpenStruct)
The text was updated successfully, but these errors were encountered:
Release 1.2.2, which contains #75 gets #freeze working, however #deep_freeze still does not work as expected, and is still an open problem.
#freeze
#deep_freeze
Sorry, something went wrong.
Maybe I'll submit another PR for #deep_freeze if I can find the time. :)
No branches or pull requests
Freeze does not work:
Deep freeze would be nice:
This could be done after initialization if
immutable: true
has been given:The text was updated successfully, but these errors were encountered: