schwad (Nick Schwaderer) wrote in #note-10: > I think the issues/problems specified in the comments are not present with a Hash-only implementation. :) > ... The XKeys gem does not meet your requirements? bkatzung (Brian Katzung)
Gem XKeys, since 2014. ``` require 'xkeys' h = {}.extend XKeys::Auto # auto Hash/Array h[:accent, 2, :original] = "the value to set" # {:accent=>[nil, nil, {:original=>"the value to set"}]} h = {}.extend XKeys::Hash # Hash only...bkatzung (Brian Katzung)
Much of this has been available through my XKeys gem since Q2 2014. ``` data = {}.extend XKeys::Auto # Vs ::Hash, uses arrays for int keys data[:users, 0, :name] # nil data[:users, 0, :name, :raise => true] # KeyError data[:users,...bkatzung (Brian Katzung)
I'm a relatively new Ruby programmer so I may have missed some of the nuances, but I have written http://rubygems.org/gems/extended_include that I *believe* satisfies the original posting requirements. In a nutshell: ~~~ require '...bkatzung (Brian Katzung)