Implement to_h for OpenStruct