Module: NanDoc::SecretParent
- Defined in:
- lib/nandoc/support-modules.rb
Instance Method Summary collapse
- #parent ⇒ Object
-
#parent=(mixed) ⇒ Object
set parent attribute without it showing up in inspect() dumps.
- #parent? ⇒ Boolean
Instance Method Details
#parent ⇒ Object
220 221 222 |
# File 'lib/nandoc/support-modules.rb', line 220 def parent nil end |
#parent=(mixed) ⇒ Object
set parent attribute without it showing up in inspect() dumps
211 212 213 214 215 216 |
# File 'lib/nandoc/support-modules.rb', line 211 def parent= mixed fail("no clear_parent() available yet.") unless mixed @has_parent = !! mixed class << self; self end.send(:define_method, :parent){mixed} mixed # maybe chain assignmnet of 1 parent to several cx at once end |
#parent? ⇒ Boolean
217 218 219 |
# File 'lib/nandoc/support-modules.rb', line 217 def parent? instance_variable_defined?('@has_parent') && @has_parent # no warnings end |