Class: YTLJit::ClassClassWrapper
Overview
Singleton class can’t be marshaled. So this class wrap to marshal singleton class
Instance Method Summary collapse
- #ancestors ⇒ Object
-
#initialize(clsobj) ⇒ ClassClassWrapper
constructor
A new instance of ClassClassWrapper.
- #marshal_dump ⇒ Object
- #marshal_load(obj) ⇒ Object
- #name ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(clsobj) ⇒ ClassClassWrapper
Returns a new instance of ClassClassWrapper.
55 56 57 58 |
# File 'lib/ytljit/util.rb', line 55 def initialize(clsobj) @klass_object = clsobj @value = nil end |
Instance Method Details
#ancestors ⇒ Object
73 74 75 |
# File 'lib/ytljit/util.rb', line 73 def ancestors value.ancestors end |
#marshal_dump ⇒ Object
77 78 79 |
# File 'lib/ytljit/util.rb', line 77 def marshal_dump [@klass_object] end |
#marshal_load(obj) ⇒ Object
81 82 83 84 |
# File 'lib/ytljit/util.rb', line 81 def marshal_load(obj) @klass_object = obj @value = nil end |
#name ⇒ Object
69 70 71 |
# File 'lib/ytljit/util.rb', line 69 def name value.name end |
#value ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/ytljit/util.rb', line 60 def value if @value then @value else @value = class << @klass_object; self; end @value end end |