Class: Lumberjack::Formatter::StripFormatter
- Inherits:
-
Object
- Object
- Lumberjack::Formatter::StripFormatter
- Defined in:
- lib/lumberjack/formatter/strip_formatter.rb
Overview
Format an object by calling to_s on it and stripping leading and trailing whitespace. This formatter is useful for cleaning up string values that may have unwanted whitespace from user input, file processing, or other sources.
The StripFormatter combines string conversion with whitespace normalization, making it ideal for attribute values that should be clean and consistent in log output.
Instance Method Summary collapse
-
#call(obj) ⇒ String
Convert an object to a string and remove leading and trailing whitespace.
Instance Method Details
#call(obj) ⇒ String
Convert an object to a string and remove leading and trailing whitespace.
19 20 21 |
# File 'lib/lumberjack/formatter/strip_formatter.rb', line 19 def call(obj) obj.to_s.strip end |