class Sablon::HTMLConverter::Collection

A container for an array of AST nodes with convenience methods to work with the internal array as if it were a regular node

Attributes

nodes[R]

Public Class Methods

new(nodes) click to toggle source
# File lib/sablon/html/ast.rb, line 102
def initialize(nodes)
  @properties ||= nil
  @attributes ||= {}
  @nodes = nodes
end

Public Instance Methods

<<(node) click to toggle source
# File lib/sablon/html/ast.rb, line 123
def <<(node)
  @nodes << node
end
accept(visitor) click to toggle source
Calls superclass method Sablon::HTMLConverter::Node#accept
# File lib/sablon/html/ast.rb, line 108
def accept(visitor)
  super
  @nodes.each do |node|
    node.accept(visitor)
  end
end
inspect() click to toggle source
# File lib/sablon/html/ast.rb, line 119
def inspect
  "[#{nodes.map(&:inspect).join(', ')}]"
end
to_docx() click to toggle source
# File lib/sablon/html/ast.rb, line 115
def to_docx
  nodes.map(&:to_docx).join
end