Class: AsciidoctorVaped::AST::Document

Inherits:
Node
  • Object
show all
Defined in:
lib/asciidoctor_vaped/ast/document.rb

Constant Summary

Constants inherited from Node

Node::TEXT_CONTEXTS

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #parent

Instance Method Summary collapse

Methods inherited from Node

#<<, #append, #append_children, #parse_inline, #sections, #text

Constructor Details

#initialize(source, attributes: {}) ⇒ Document

Returns a new instance of Document.



11
12
13
14
15
# File 'lib/asciidoctor_vaped/ast/document.rb', line 11

def initialize(source, attributes: {})
  @attributes = attributes.dup
  @source = source
  super()
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



9
10
11
# File 'lib/asciidoctor_vaped/ast/document.rb', line 9

def attributes
  @attributes
end

#doctitleObject

Returns the value of attribute doctitle.



8
9
10
# File 'lib/asciidoctor_vaped/ast/document.rb', line 8

def doctitle
  @doctitle
end

Instance Method Details

#contextObject



17
18
19
# File 'lib/asciidoctor_vaped/ast/document.rb', line 17

def context
  :document
end

#register_attribute(name, value) ⇒ Object



25
26
27
# File 'lib/asciidoctor_vaped/ast/document.rb', line 25

def register_attribute(name, value)
  attributes[name.to_s] = value
end

#sourceObject



21
22
23
# File 'lib/asciidoctor_vaped/ast/document.rb', line 21

def source
  @source.dup
end

#to_hObject



29
30
31
# File 'lib/asciidoctor_vaped/ast/document.rb', line 29

def to_h
  super.merge(doctitle:)
end