Class: DeepCover::AutoloadTracker::AutoloadEntry
- Inherits:
-
Struct
- Object
- Struct
- DeepCover::AutoloadTracker::AutoloadEntry
- Defined in:
- lib/deep_cover/autoload_tracker.rb
Instance Attribute Summary collapse
-
#interceptor_path ⇒ Object
Returns the value of attribute interceptor_path.
-
#name ⇒ Object
Returns the value of attribute name.
-
#target_path ⇒ Object
Returns the value of attribute target_path.
-
#weak_mod ⇒ Object
Returns the value of attribute weak_mod.
Instance Method Summary collapse
-
#mod_if_available ⇒ Object
If the ref is dead, will return nil If the target is frozen, will warn and return nil Otherwise return the target.
Instance Attribute Details
#interceptor_path ⇒ Object
Returns the value of attribute interceptor_path
9 10 11 |
# File 'lib/deep_cover/autoload_tracker.rb', line 9 def interceptor_path @interceptor_path end |
#name ⇒ Object
Returns the value of attribute name
9 10 11 |
# File 'lib/deep_cover/autoload_tracker.rb', line 9 def name @name end |
#target_path ⇒ Object
Returns the value of attribute target_path
9 10 11 |
# File 'lib/deep_cover/autoload_tracker.rb', line 9 def target_path @target_path end |
#weak_mod ⇒ Object
Returns the value of attribute 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_available ⇒ Object
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 |