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
Seems like default value is returned but not stored.
Not sure if it makes sense to have that feature in Hashie, but it would be useful for creation of nested hashes.
> h = Hashie::Mash.new nil, {} => {} > h.a['b'] = 1 => 1 > h.inspect => "#<Hashie::Mash>"
The text was updated successfully, but these errors were encountered:
I think this could be useful, indeed.
Sorry, something went wrong.
This is a way to get nested hash
> nested_hash = Hash.new { |hash, key| hash[key] = Hash.new(&hash.default_proc) } => {} > nested_hash[:x][:y][:z] = :xyz => :xyz > nested_hash => {:x=>{:y=>{:z=>:xyz}}}
but this does not work for Hashie
h = Hashie::Mash.new { |mash, key| mash[key] = mash.class.new(&mash.default_proc) } => {} > h[:x][:y][:z] = :xyz => :xyz > h => {"x"=>{}}
Seems like this might be a duplicate of #60. I agree that it's useful and I think implementing this would also handle the other case!
@michaelherold @dblock the last case reported by @antulik is actually a bug
@brauliobo Want to take a stab at fixing it? At least write a spec?
default_proc
michaelherold
No branches or pull requests
Seems like default value is returned but not stored.
Not sure if it makes sense to have that feature in Hashie, but it would be useful for creation of nested hashes.
The text was updated successfully, but these errors were encountered: