We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a10066a commit 75a58afCopy full SHA for 75a58af
lib/mongo/options/sensitive_options.rb
@@ -22,15 +22,21 @@ class SensitiveOptions < BSON::Document
22
23
def inspect
24
'{' + reduce('') do |string, (k, v)|
25
- string << "#{k}=>#{redact(k,v)}"
+ string << "#{k.inspect}=>#{redact(k, v, __method__)}"
26
+ end + '}'
27
+ end
28
+
29
+ def to_s
30
+ '{' + reduce('') do |string, (k, v)|
31
+ string << "#{k.to_s}=>#{redact(k, v, __method__)}"
32
end + '}'
33
end
34
35
private
36
- def redact(k, v)
37
+ def redact(k, v, method)
38
return REDACTED_STRING if SENSITIVE_OPTIONS.include?(k.to_sym)
- v.inspect
39
+ v.send(method)
40
41
42
0 commit comments