When should I use an OpenStruct instead of a Hash?
OpenStruct objects are useful when you need something to fit a certain method call interface (i.e. send in a duck-typed object responding to #name and #value), or when you want to encapsulate the implementation details, but also want to avoid over-engineering the solution. They also make an awesome stub object, and I often use them … Read more