confstruct icon indicating copy to clipboard operation
confstruct copied to clipboard

'format' key is lost if confstruct is initialized with blocks.

Open lstrzebinczyk opened this issue 12 years ago • 1 comments

Consider this example:

conf = Confstruct::Configuration.new do
  format "XML"
end

If initialised like this, conf will return empty hash. If confstruct is initialised via hash, the key is not there.

We, however, like block initialising very much, and key named 'format' is important for us. I would be very happy to see this fixed: )

lstrzebinczyk avatar Apr 13 '13 12:04 lstrzebinczyk

I'm not sure where the format method is being predefined, but you can overcome this issue by using the other variation of the block format that yields a configuration object:

conf = Confstruct::Configuration.new do |c|
  c.format "XML"
end

I'll look into a fix, but this will allow you to move forward in the meantime.

mbklein avatar Apr 23 '13 14:04 mbklein