Class: ActionDispatch::ExceptionWrapper::SourceMapLocation

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

Instance Method Summary collapse

Constructor Details

#initialize(location, template) ⇒ SourceMapLocation

Returns a new instance of SourceMapLocation.



225
226
227
228
# File 'actionpack/lib/action_dispatch/middleware/exception_wrapper.rb', line 225

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

Instance Method Details

#spot(exc) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
# File 'actionpack/lib/action_dispatch/middleware/exception_wrapper.rb', line 230

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

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