Class: DeepCover::AutoloadTracker::AutoloadEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/deep_cover/autoload_tracker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#interceptor_pathObject

Returns the value of attribute interceptor_path

Returns:

  • (Object)

    the current value of interceptor_path



9
10
11
# File 'lib/deep_cover/autoload_tracker.rb', line 9

def interceptor_path
  @interceptor_path
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



9
10
11
# File 'lib/deep_cover/autoload_tracker.rb', line 9

def name
  @name
end

#target_pathObject

Returns the value of attribute target_path

Returns:

  • (Object)

    the current value of target_path



9
10
11
# File 'lib/deep_cover/autoload_tracker.rb', line 9

def target_path
  @target_path
end

#weak_modObject

Returns the value of attribute weak_mod

Returns:

  • (Object)

    the current value of weak_mod



9
10
11
# File 'lib/deep_cover/autoload_tracker.rb', line 9

def weak_mod
  @weak_mod
end

Instance Method Details

#mod_if_availableObject

If the ref is dead, will return nil If the target is frozen, will warn and return nil Otherwise return the target



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/deep_cover/autoload_tracker.rb', line 13

def mod_if_available
  mod = weak_mod.__getobj__
  if mod.frozen?
    AutoloadTracker.warn_frozen_module(mod)
    nil
  else
    mod
  end
rescue WeakRef::RefError
  nil
end