Class: Coradoc::Element::Table::Row
- Inherits:
-
Object
- Object
- Coradoc::Element::Table::Row
- Defined in:
- lib/coradoc/element/table.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
-
#initialize(columns, header = false) ⇒ Row
constructor
A new instance of Row.
- #table_header_row? ⇒ Boolean
- #to_adoc ⇒ Object
- #underline_for ⇒ Object
Constructor Details
#initialize(columns, header = false) ⇒ Row
Returns a new instance of Row.
27 28 29 30 |
# File 'lib/coradoc/element/table.rb', line 27 def initialize(columns, header = false) @columns = columns @header = header end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
25 26 27 |
# File 'lib/coradoc/element/table.rb', line 25 def columns @columns end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
25 26 27 |
# File 'lib/coradoc/element/table.rb', line 25 def header @header end |
Instance Method Details
#table_header_row? ⇒ Boolean
32 33 34 |
# File 'lib/coradoc/element/table.rb', line 32 def table_header_row? @header end |
#to_adoc ⇒ Object
36 37 38 39 40 |
# File 'lib/coradoc/element/table.rb', line 36 def to_adoc content = Coradoc::Generator.gen_adoc(@columns).rstrip result = "#{content}\n" table_header_row? ? result + underline_for : result end |
#underline_for ⇒ Object
42 43 44 |
# File 'lib/coradoc/element/table.rb', line 42 def underline_for "\n" end |