Revised Ruby example so result is an object, not just a hash.