Class: RailsMemoryProfiler::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/rails_memory_profiler/engine.rb

Class Method Summary collapse

Class Method Details

.mount_pathObject



10
11
12
13
14
15
16
17
# File 'lib/rails_memory_profiler/engine.rb', line 10

def mount_path
  @mount_path ||= begin
    mounted = Rails.application.routes.routes.find do |route|
      route.app.app == self rescue false
    end
    mounted&.path&.spec&.to_s&.gsub(/\([^)]*\)/, "")
  end
end

.reset_mount_path!Object



19
20
21
# File 'lib/rails_memory_profiler/engine.rb', line 19

def reset_mount_path!
  @mount_path = nil
end