Remove Util.titlecase_parts method

This commit is contained in:
Tim Craft 2018-09-05 14:25:39 +01:00
parent 1bbbfd4e66
commit 92775b1358

View File

@ -276,11 +276,8 @@ module Stripe
# diffent naming schemes.
def self.normalize_headers(headers)
headers.each_with_object({}) do |(k, v), new_headers|
if k.is_a?(Symbol)
k = titlecase_parts(k.to_s.tr("_", "-"))
elsif k.is_a?(String)
k = titlecase_parts(k)
end
k = k.to_s.tr("_", "-") if k.is_a?(Symbol)
k = k.split("-").reject(&:empty?).map(&:capitalize).join("-")
new_headers[k] = v
end
@ -368,14 +365,6 @@ module Stripe
end
private_class_method :log_internal
def self.titlecase_parts(s)
s.split("-")
.reject { |p| p == "" }
.map { |p| p[0].upcase + p[1..-1].downcase }
.join("-")
end
private_class_method :titlecase_parts
# Wraps a value in double quotes if it looks sufficiently complex so that
# it can be read by logfmt parsers.
def self.wrap_logfmt_value(val)