Class: Markbridge::AST::Table

Inherits:
Element show all
Defined in:
lib/markbridge/ast/table.rb

Overview

Represents a table element containing rows.

Examples:

table = AST::Table.new
table << AST::TableRow.new

Instance Attribute Summary

Attributes inherited from Element

#children

Instance Method Summary collapse

Methods inherited from Element

#initialize

Constructor Details

This class inherits a constructor from Markbridge::AST::Element

Instance Method Details

#<<(child) ⇒ Table

Add a child node to the table. Whitespace-only Text nodes are ignored.

Parameters:

  • child (Node)

    the node to add

Returns:

  • (Table)

    self for chaining



16
17
18
19
20
# File 'lib/markbridge/ast/table.rb', line 16

def <<(child)
  return self if child.is_a?(Text) && child.text.strip.empty?

  super
end