Class: Tracebook::Redactors::Base
- Inherits:
-
Object
- Object
- Tracebook::Redactors::Base
- Defined in:
- lib/tracebook/redactors/base.rb
Instance Method Summary collapse
Instance Method Details
#applies_to ⇒ Object
12 13 14 |
# File 'lib/tracebook/redactors/base.rb', line 12 def applies_to :both end |
#call(value) ⇒ Object
6 7 8 9 10 |
# File 'lib/tracebook/redactors/base.rb', line 6 def call(value) return value unless value.is_a?(String) value.gsub(pattern, replacement) end |
#pattern ⇒ Object (private)
18 19 20 |
# File 'lib/tracebook/redactors/base.rb', line 18 def pattern raise NotImplementedError, "implement in subclasses" end |
#replacement ⇒ Object (private)
22 23 24 |
# File 'lib/tracebook/redactors/base.rb', line 22 def replacement "[REDACTED]" end |