Class: ActionDispatch::ExceptionWrapper::SourceMapLocation

Inherits:
Thread::Backtrace::Location
  • Object
show all
Defined in:
lib/action_dispatch/middleware/exception_wrapper.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(location, template) ⇒ SourceMapLocation

Returns a new instance of SourceMapLocation.



234
235
236
237
# File 'lib/action_dispatch/middleware/exception_wrapper.rb', line 234

def initialize(location, template)
  super(location)
  @template = template
end

Instance Method Details

#spot(exc) ⇒ Object



239
240
241
242
243
244
245
246
247
248
249
# File 'lib/action_dispatch/middleware/exception_wrapper.rb', line 239

def spot(exc)
  if RubyVM::AbstractSyntaxTree.respond_to?(:node_id_for_backtrace_location) && __getobj__.is_a?(Thread::Backtrace::Location)
    location = @template.spot(__getobj__)
  else
    location = super
  end

  if location
    @template.translate_location(__getobj__, location)
  end
end