soulcutter / saxerator

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

Slice does not work on HashElements #54

Closed WvanLelyveld closed 7 years ago

WvanLelyveld commented 7 years ago

I expect slice to work like on a normal Ruby hash. This now fails with the error: ArgumentError: wrong number of arguments (given 0, expected 2)

If this is not possible and I should just convert it to a normal Ruby hash, that's fine, how do I do that?

fanantoxa commented 7 years ago

@WvanLelyveld As I see slice for hash - it's extention from ActiveSupport on RoR:

http://apidock.com/rails/Hash/slice

Since HashElement deletes to Hash element, It's might be not here. class HashElement < DelegateClass(Hash)

You could try to convert to Hash with .to_h or use another methods from Hash or Enumerable

fanantoxa commented 7 years ago

Close this since it's not related to saxerator