Class: Gemtext::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/gemtext/document.rb

Overview

‘Gemtext::Document` represents a gemtext document or “page”. It consists of a sequence of `Gemtext::Node`s

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDocument

Returns a new instance of Document.



19
20
21
# File 'lib/gemtext/document.rb', line 19

def initialize
  @nodes = []
end

Instance Attribute Details

#nodesObject (readonly)

Nodes



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

def nodes
  @nodes
end

Instance Method Details

#push(node) ⇒ Object



23
24
25
# File 'lib/gemtext/document.rb', line 23

def push(node)
  @nodes << node if node.is_a? Gemtext::Node
end