Class: Lumberjack::Formatter::ObjectFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/lumberjack/formatter/object_formatter.rb

Overview

No-op formatter that returns the object unchanged. This formatter is useful as a default or fallback formatter when you want to preserve the original object without any transformation.

The ObjectFormatter is commonly used in scenarios where you want to maintain the original data structure and let downstream components handle the actual formatting, or when you need a placeholder formatter in the formatter chain.

Instance Method Summary collapse

Instance Method Details

#call(obj) ⇒ Object

Return the object unchanged.

Parameters:

  • obj (Object)

    The object to format.

Returns:

  • (Object)

    The original object without any modifications.



19
20
21
# File 'lib/lumberjack/formatter/object_formatter.rb', line 19

def call(obj)
  obj
end