This one is weird edge case of some kind, but i'm not sure what kind. Here's the reproduction:
conf = Confstruct::Configuration.new
conf.configure( :top=>{:middle=>{"one"=>"two"}} )
conf.top.middle # => {"one"=>"two"}
conf.top.middle.class # => Confstruct::HashWithStructAccess
conf.top.middle.one # => nil WHAT?
conf.top.middle["one"] # => nil # uh?
conf.top.middle[:one] #=> nil
What's going on? Is "one" somehow a reserved word too? Not sure. If we change the literal to a symbol, weirdly all is well. huh?
conf = Confstruct::Configuration.new
conf.configure( :top=>{:middle=>{:one=>"two"}} )
conf.top.middle.one # => "two" # great!
Hmm, a string other than 'one'?
conf = Confstruct::Configuration.new
conf.configure( :top=>{:middle=>{"foo"=>"two"}} )
conf.top.middle # {"foo"=>"two"}
conf.top.middle.foo # => nil
Nope it's not the word 'one' I don't think.
But it doens't require three levels of nesting, one will do it with strings:
conf = Confstruct::Configuration.new
conf.configure("top" => { "bottom" => "bottom" })
conf.top # => {"bottom" => "bottom" }
conf.top.class # => Confstruct::HashWithStructAccess
conf.top.bottom # => nil
conf.top["bottom"] #=> nil
conf.top.keys # => ["bottom"] WHAT???
Ugh. Any ideas?
This one is weird edge case of some kind, but i'm not sure what kind. Here's the reproduction:
What's going on? Is "one" somehow a reserved word too? Not sure. If we change the literal to a symbol, weirdly all is well. huh?
Hmm, a string other than 'one'?
Nope it's not the word 'one' I don't think.
But it doens't require three levels of nesting, one will do it with strings:
Ugh. Any ideas?