Class: Lumberjack::Formatter::StructuredFormatter

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

Overview

Dereference arrays and hashes and recursively call formatters on each element.

Defined Under Namespace

Classes: RecusiveReferenceError

Instance Method Summary collapse

Constructor Details

#initialize(formatter = nil) ⇒ StructuredFormatter

Returns a new instance of StructuredFormatter.



12
13
14
# File 'lib/lumberjack/formatter/structured_formatter.rb', line 12

def initialize(formatter = nil)
  @formatter = formatter
end

Instance Method Details

#call(obj) ⇒ Object



16
17
18
# File 'lib/lumberjack/formatter/structured_formatter.rb', line 16

def call(obj)
  call_with_references(obj, Set.new)
end