Module: ObjectTracer::Output::Helpers

Included in:
ObjectTracer
Defined in:
lib/object_tracer/output.rb

Instance Method Summary collapse

Instance Method Details

#and_output(payload_method = nil, options: {}, logger:, &block) ⇒ Object



22
23
24
25
26
# File 'lib/object_tracer/output.rb', line 22

def and_output(payload_method = nil, options: {}, logger:, &block)
  output_block = generate_output_block(payload_method, block)
  @output_writer = Writer.new(options: options, output_block: output_block, logger: logger)
  self
end

#and_print(payload_method = nil, options: {}, &block) ⇒ Object



18
19
20
# File 'lib/object_tracer/output.rb', line 18

def and_print(payload_method = nil, options: {}, &block)
  and_output(payload_method, options: options, logger: Logger.new($stdout), &block)
end

#and_write(payload_method = nil, options: {}, &block) ⇒ Object



14
15
16
# File 'lib/object_tracer/output.rb', line 14

def and_write(payload_method = nil, options: {}, &block)
  and_output(payload_method, options: options, logger: Logger.new(options[:log_file]), &block)
end