PersistentOpenStruct: a faster OpenStruct
Addressing a situation where we wanted to use OpenStruct as a flexible data container but didn’t want the awful performance, I put together a faster version which defines methods on the class rather than defining singleton methods on the object. This gem is ideal for situations where you need flexibility at runtime, but you’re basically using the same set of keys again and again. It’s available on RubyGems as persistent_open_struct
, and you can learn more at the GitHub repo and on my blog.
Post a comment