Module: StoryTeller::Library::LocationTracePoint

Defined in:
lib/story_teller/library/location.rb

Overview

module LocationTracePoint

Class Method Summary collapse

Class Method Details

.install_or_defer!Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/story_teller/library/location.rb', line 54

def install_or_defer!
  return true if StoryTeller::Library::LocationInstaller.install!
  return false if defined?(@trace_point) && @trace_point&.enabled?

  @trace_point = TracePoint.new(:class) do |_tp|
    next unless defined?(InformLibrary)
    next unless StoryTeller::Library::LocationInstaller.install!

    @trace_point.disable
    @trace_point = nil
  end

  @trace_point.enable
  false
end