Class: Coradoc::Element::Table::Row
- Inherits:
-
Base
- Object
- Base
- Coradoc::Element::Table::Row
show all
- Defined in:
- lib/coradoc/element/table.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
access_children, #children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(columns, header = false) ⇒ Row
30
31
32
33
|
# File 'lib/coradoc/element/table.rb', line 30
def initialize(columns, = false)
@columns = columns
=
end
|
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
26
27
28
|
# File 'lib/coradoc/element/table.rb', line 26
def columns
@columns
end
|
Returns the value of attribute header.
26
27
28
|
# File 'lib/coradoc/element/table.rb', line 26
def
end
|
Instance Method Details
#asciidoc? ⇒ Boolean
39
40
41
|
# File 'lib/coradoc/element/table.rb', line 39
def asciidoc?
@columns.any? { |c| c.respond_to?(:asciidoc?) && c.asciidoc? }
end
|
35
36
37
|
# File 'lib/coradoc/element/table.rb', line 35
def
end
|
#to_adoc ⇒ Object
43
44
45
46
47
48
49
50
51
|
# File 'lib/coradoc/element/table.rb', line 43
def to_adoc
delim = asciidoc? ? "\n" : " "
content = @columns.map do |col|
Coradoc::Generator.gen_adoc(col)
end.join(delim)
result = "#{content}\n"
result << "\n" if asciidoc?
? result + underline_for : result
end
|
#underline_for ⇒ Object
53
54
55
|
# File 'lib/coradoc/element/table.rb', line 53
def underline_for
"\n"
end
|