Module: NanDoc::SecretParent

Included in:
Helpers::NanDocHelpers::SiteMap, NanDoc::StreamColorizer::State
Defined in:
lib/nandoc/support-modules.rb

Instance Method Summary collapse

Instance Method Details

#parentObject



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

Returns:

  • (Boolean)


217
218
219
# File 'lib/nandoc/support-modules.rb', line 217

def parent?
  instance_variable_defined?('@has_parent') && @has_parent # no warnings
end