class RDoc::Markup::Table

A section of table

Attributes

Alignments of each column

: Array

Body texts of each column

: Array

Headers of each column

: Array

Public Class Methods

: (Array, Array, Array) -> void

# File lib/rdoc/markup/table.rb, line 20
def initialize(header, align, body)
  @header, @align, @body = header, align, body
end

Public Instance Methods

: (Object) -> bool

# File lib/rdoc/markup/table.rb, line 25
def ==(other)
  self.class == other.class && @header == other.header &&
    @align == other.align && @body == other.body
end
@override

: (untyped) -> void

# File lib/rdoc/markup/table.rb, line 32
def accept(visitor)
  visitor.accept_table(@header, @body, @align)
end
@override

: (untyped) -> String

# File lib/rdoc/markup/table.rb, line 38
def pretty_print(q)
  q.group 2, '[Table: ', ']' do
    q.group 2, '[Head: ', ']' do
      q.seplist @header.zip(@align) do |text, align|
        q.pp text
        if align
          q.text ":"
          q.breakable
          q.text align.to_s
        end
      end
    end
    q.breakable
    q.group 2, '[Body: ', ']' do
      q.seplist @body do |body|
        q.group 2, '[', ']' do
          q.seplist body do |text|
            q.pp text
          end
        end
      end
    end
  end
end