lib/google/cloud/spanner/convert.rb in google-cloud-spanner-2.8.1 vs lib/google/cloud/spanner/convert.rb in google-cloud-spanner-2.9.0
- old
+ new
@@ -322,9 +322,28 @@
input_param_pairs.map { |k, v| [k, v.last] }]
end
[input_params, input_param_types]
end
+
+ ##
+ # Build request options by replacing tag to respecitve statistics
+ # collection tag type.
+ #
+ # @param [Hash] options Common request options.
+ # * `:tag` (String) A tag used for statistics collection.
+ #
+ # @param [Symbol] tag_type Request tag type.
+ # Possible values are `request_tag`, `transaction_tag`
+ # @return [Hash, nil]
+ #
+ def to_request_options options, tag_type: nil
+ return unless options
+
+ return options unless options.key? :tag
+
+ options.transform_keys { |k| k == :tag ? tag_type : k }
+ end
end
# rubocop:enable all
extend ClassMethods