Class: RDoc::Markup::Table
Overview
A section of table
Instance Attribute Summary collapse
-
#align ⇒ Object
Alignments of each column : Array.
-
#body ⇒ Object
Body texts of each column : Array.
-
#header ⇒ Object
Headers of each column : Array.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (Object) -> bool.
-
#accept(visitor) ⇒ Object
: (untyped) -> void.
- #initialize(header, align, body) ⇒ Table constructor
-
#pretty_print(q) ⇒ Object
: (untyped) -> String.
Constructor Details
Instance Attribute Details
#align ⇒ Object
Alignments of each column : Array
13 14 15 |
# File 'lib/rdoc/markup/table.rb', line 13 def align @align end |
#body ⇒ Object
Body texts of each column : Array
17 18 19 |
# File 'lib/rdoc/markup/table.rb', line 17 def body @body end |
#header ⇒ Object
Headers of each column : Array
9 10 11 |
# File 'lib/rdoc/markup/table.rb', line 9 def header @header end |
Instance Method Details
#==(other) ⇒ Object
: (Object) -> bool
25 26 27 28 |
# File 'lib/rdoc/markup/table.rb', line 25 def ==(other) self.class == other.class && @header == other.header && @align == other.align && @body == other.body end |
#accept(visitor) ⇒ Object
: (untyped) -> void
32 33 34 |
# File 'lib/rdoc/markup/table.rb', line 32 def accept(visitor) visitor.accept_table(@header, @body, @align) end |
#pretty_print(q) ⇒ Object
: (untyped) -> String
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# 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 |