class Paru::PandocFilter::TableEnd

A TableEnd node is the base class for the TableHead and TableFoot nodes. It has attributes and one or more rows.

@!attribute attr

@return Attr

@!attribute rows

@return [Row]

Attributes

attr[RW]

Public Class Methods

new(contents) click to toggle source

Create a new TableEnd based on the contents

@param contents [Array]

Calls superclass method
# File lib/paru/filter/table_end.rb, line 39
def initialize(contents)
    @attr = Attr.new contents[0]
    super []
    contents[1].each do |row|
        @children.push Row.new row
    end
end

Public Instance Methods

ast_contents() click to toggle source

The AST contents of this Table node

@return [Array]

# File lib/paru/filter/table_end.rb, line 54
def ast_contents()
    [
        @attr.to_ast,
        @children.map {|row| row.to_ast},
    ]
end
rows() click to toggle source
# File lib/paru/filter/table_end.rb, line 47
def rows()
  @children
end
to_array() click to toggle source

Convert this table end to a 2D table of markdown strings for each cell

@return [String[]] This Table as a 2D array of cells represented by their markdown strings.

# File lib/paru/filter/table_end.rb, line 73
def to_array()
    @children.map do |row|
        row.to_array
    end
end
to_ast() click to toggle source

Create an AST representation of this Node

@return [Hash]

# File lib/paru/filter/table_end.rb, line 64
def to_ast()
  ast_contents()
end