Ruby: allow Google::Protobuf::Map#to_h to accept a block
In Ruby, Google::Protobuf::Map is an Enumerable. From the Ruby documentation for Enumerable#to_h:
If a block is given, the results of the block on each element of the enum will be used as pairs.
This PR adds the ability to pass in a block and have the described behavior.
This is useful, otherwise we'd need to do something like call map and then to_h, which allocates intermediate results.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Before we can review this PR, please sign the CLA.
Before we can review this PR, please sign the CLA.
Done!