"display" reserved word for key?
Is there a reason "display" would be a reserved word for a key? Traced my weird bug down to that.
hash = {:display=> "display", :foo => 'foo'}
conf = Confstruct::Configuration.new( hash )
conf.foo # => 'foo'
conf.display # => #<Confstruct::Configuration:0x0000000fff4b78>nil
conf[:display] # => 'display'
Looks like 'display' is for some reason 'special'/reserved, but I am not sure why or if this is a bug. Took me a while to reproduce and figure out it really was the key 'display' that did it!
Ah, weird #display is a method on ruby Object, although not one I had ever heard of or seen before. http://apidock.com/ruby/v1_9_2_180/Object/display
Okay then.
I wonder if confstruct actually ought to remove some methods from Object, or use 1.9 "BasicObject" or something. I dunno, I guess this is just downside of automatic struct-ization like that.
Huh, I had never heard of #display, either. Interesting. I'm already removing some methods from Object, but I can take a look at this one sometime next week.
We are now having facing the same issue with the name entries. Do you plan to support names of functions that already exist as well?
I've been using railsconfig for a while now, so I can't say there's going to be much ongoing support for confstruct. I'm happy to consider PRs and work others want to contribute, but I probably won't be making direct improvements myself.