Class: ProductionBreakpoints::Breakpoints::Locals
- Defined in:
- lib/ruby-production-breakpoints/breakpoints/locals.rb
Overview
Show local variables and their values
Constant Summary collapse
- TRACEPOINT_TYPES =
FIXME: refactor a bunch of these idioms into Base
[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 17 18 |
# File 'lib/ruby-production-breakpoints/breakpoints/locals.rb', line 9 def handle(caller_binding, &block) return super(caller_binding, &block) unless @tracepoint.enabled? val = super(caller_binding, &block) locals = caller_binding.local_variables locals.delete(:local_bind) vals = locals.map { |v| [v, caller_binding.local_variable_get(v)] }.to_h @tracepoint.fire(vals.to_json) resume(caller_binding, &block) || val end |