Module: Enhanced::ExceptionBindingInfos

Included in:
Exception
Defined in:
lib/enhanced/exception.rb

Instance Method Summary collapse

Instance Method Details

#binding_infosObject



6
7
8
9
10
11
12
13
# File 'lib/enhanced/exception.rb', line 6

def binding_infos
  ctx = Enhanced::ExceptionContext.context_for(self)
  unless ctx
    ctx = Context.new
    Enhanced::ExceptionContext.store_context(self, ctx)
  end
  ctx.binding_infos
end

#captured_variablesObject



15
16
17
18
19
20
21
# File 'lib/enhanced/exception.rb', line 15

def captured_variables
  return '' unless binding_infos&.any?
  bindings_of_interest = select_binding_infos
  EnhancedErrors.format(bindings_of_interest)
rescue
  ''
end