Class: ArgScanner::TypeTracker

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/arg_scanner/type_tracker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTypeTracker

Returns a new instance of TypeTracker.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/arg_scanner/type_tracker.rb', line 54

def initialize
  ArgScanner.init(ENV['ARG_SCANNER_PIPE_FILE_PATH'], ENV['ARG_SCANNER_BUFFERING'],
                  ENV['ARG_SCANNER_PROJECT_ROOT'], ENV['ARG_SCANNER_CATCH_ONLY_EVERY_N_CALL'])

  @enable_debug = ENV["ARG_SCANNER_DEBUG"]
  @performance_monitor = if @enable_debug then TypeTrackerPerformanceMonitor.new else nil end

  TracePoint.trace(:call, &ArgScanner.method(:handle_call))

  TracePoint.trace(:return, &ArgScanner.method(:handle_return))

  error_msg = ArgScanner.check_if_arg_scanner_ready()
  if error_msg != nil
    STDERR.puts error_msg
    Process.exit(1)
  end

  ObjectSpace.define_finalizer(self, proc { ArgScanner.destructor() })
end

Instance Attribute Details

#enable_debugObject

Returns the value of attribute enable_debug.



74
75
76
# File 'lib/arg_scanner/type_tracker.rb', line 74

def enable_debug
  @enable_debug
end

#performance_monitorObject

Returns the value of attribute performance_monitor.



75
76
77
# File 'lib/arg_scanner/type_tracker.rb', line 75

def performance_monitor
  @performance_monitor
end

#prefixObject

Returns the value of attribute prefix.



76
77
78
# File 'lib/arg_scanner/type_tracker.rb', line 76

def prefix
  @prefix
end