Method: Asciidoctor::AbstractNode#initialize

Defined in:
lib/asciidoctor/abstract_node.rb

#initialize(parent, context, opts = {}) ⇒ AbstractNode

Returns a new instance of AbstractNode.



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/asciidoctor/abstract_node.rb', line 28

def initialize parent, context, opts = {}
  # document is a special case, should refer to itself
  if context == :document
    @document = self
  elsif parent
    @document = (@parent = parent).document
  end
  @node_name = (@context = context).to_s
  # NOTE the value of the :attributes option may be nil on an Inline node
  @attributes = (attrs = opts[:attributes]) ? attrs.merge : {}
  @passthroughs = []
end