`each_with_object` is fine. `reduce` is a bit awkward because of having to return the accumulator from the block, which is unnecessary for a simple case like this.