Class: WeakRef
- Inherits:
-
Object
- Object
- WeakRef
- Defined in:
- lib/lutaml/model/runtime_compatibility.rb
Defined Under Namespace
Classes: RefError
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(obj) ⇒ WeakRef
constructor
A new instance of WeakRef.
-
#method_missing(name) ⇒ Object
Minimal method_missing so the WeakRef quacks like its target for the Store's index lookups.
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
- #weakref_alive? ⇒ Boolean
Constructor Details
#initialize(obj) ⇒ WeakRef
Returns a new instance of WeakRef.
103 104 105 |
# File 'lib/lutaml/model/runtime_compatibility.rb', line 103 def initialize(obj) @__target__ = obj end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
Minimal method_missing so the WeakRef quacks like its target for the Store's index lookups.
117 118 119 |
# File 'lib/lutaml/model/runtime_compatibility.rb', line 117 def method_missing(name, *, &) @__target__.public_send(name, *, &) end |
Instance Method Details
#__getobj__ ⇒ Object
107 108 109 |
# File 'lib/lutaml/model/runtime_compatibility.rb', line 107 def __getobj__ @__target__ end |
#respond_to_missing?(name, include_private = false) ⇒ Boolean
121 122 123 |
# File 'lib/lutaml/model/runtime_compatibility.rb', line 121 def respond_to_missing?(name, include_private = false) @__target__.respond_to?(name, include_private) end |
#weakref_alive? ⇒ Boolean
111 112 113 |
# File 'lib/lutaml/model/runtime_compatibility.rb', line 111 def weakref_alive? true end |