Class: ProductionBreakpoints::Breakpoints::Inspect

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby-production-breakpoints/breakpoints/inspect.rb

Overview

Inspect result of the last evaluated expression

Constant Summary collapse

TRACEPOINT_TYPES =
[String].freeze

Instance Attribute Summary

Attributes inherited from Base

#name, #provider_name, #tracepoint

Instance Method Summary collapse

Methods inherited from Base

#initialize, #install, #load, #resume, #uninstall, #unload

Constructor Details

This class inherits a constructor from ProductionBreakpoints::Breakpoints::Base

Instance Method Details

#handle(caller_binding, &block) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/ruby-production-breakpoints/breakpoints/inspect.rb', line 9

def handle(caller_binding, &block)
  return super(caller_binding, &block) unless @tracepoint.enabled?

  val = super(caller_binding, &block)
  @tracepoint.fire(val.inspect)

  resume(caller_binding, &block) || val
end