soulcutter / saxerator

A SAX-based XML parser for parsing large files into manageable chunks
MIT License
128 stars 19 forks source link

Allow to init Saxerator::Builder::HashElement without arguments #28

Closed exAspArk closed 9 years ago

exAspArk commented 9 years ago

Hi,

There is a rare case with serialize method from ActiveRecord. When I'm trying to use Saxerator::Builder::HashElement through this serialization it raises an error about wrong number of arguments (0 for 2).

Can we save the same initialize method's behavior as a behavior of parent class? To be able to use Saxerator::Builder::HashElement.new like Hash.new

soulcutter commented 9 years ago

I suspect that this will not be needed later on when we stop subclassing Hash - I'm not sure that even this patch it going to be fully satisfying.

soulcutter commented 9 years ago

Also worth noting that the params you pass into this object have different meaning than what you'd pass into a Hash

exAspArk commented 9 years ago

@soulcutter thank you. Yes, I agree with you and think that it's better to stop subclassing Hash.