Class: Coradoc::AsciiDoc::Model::Table

Inherits:
Base
  • Object
show all
Includes:
Anchorable
Defined in:
lib/coradoc/asciidoc/model/table.rb

Overview

Table element for AsciiDoc tables.

Represents a table with rows and cells. Tables can have titles, captions, and various formatting options.

Examples:

Create a simple table

table = Coradoc::AsciiDoc::Model::Table.new
table.rows << Coradoc::AsciiDoc::Model::TableRow.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Anchorable

#default_anchor, #gen_anchor, included, #initialize

Methods inherited from Base

#inline?, #serialize_content, #simplify_block_content, #to_adoc, #to_h, visit, #visit

Instance Attribute Details

#attrsAttributeList (readonly)

Returns Additional table attributes.

Returns:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/coradoc/asciidoc/model/table.rb', line 26

class Table < Base
  include Coradoc::AsciiDoc::Model::Anchorable

  def block_level?
    true
  end

  attribute :id, :string
  attribute :title, :string
  attribute :rows, Coradoc::AsciiDoc::Model::TableRow, collection: true
  attribute :content, :string
  # attribute :anchor, Inline::Anchor, default: -> {
  #   id.nil? ? nil : Inline::Anchor.new(id)
  # }
  attribute :attrs, Coradoc::AsciiDoc::Model::AttributeList
end

#contentString? (readonly)

Returns Optional string content.

Returns:

  • (String, nil)

    Optional string content



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/coradoc/asciidoc/model/table.rb', line 26

class Table < Base
  include Coradoc::AsciiDoc::Model::Anchorable

  def block_level?
    true
  end

  attribute :id, :string
  attribute :title, :string
  attribute :rows, Coradoc::AsciiDoc::Model::TableRow, collection: true
  attribute :content, :string
  # attribute :anchor, Inline::Anchor, default: -> {
  #   id.nil? ? nil : Inline::Anchor.new(id)
  # }
  attribute :attrs, Coradoc::AsciiDoc::Model::AttributeList
end

#idString? (readonly)

Returns Optional identifier for the table.

Returns:

  • (String, nil)

    Optional identifier for the table



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/coradoc/asciidoc/model/table.rb', line 26

class Table < Base
  include Coradoc::AsciiDoc::Model::Anchorable

  def block_level?
    true
  end

  attribute :id, :string
  attribute :title, :string
  attribute :rows, Coradoc::AsciiDoc::Model::TableRow, collection: true
  attribute :content, :string
  # attribute :anchor, Inline::Anchor, default: -> {
  #   id.nil? ? nil : Inline::Anchor.new(id)
  # }
  attribute :attrs, Coradoc::AsciiDoc::Model::AttributeList
end

#rowsArray<TableRow> (readonly)

Returns Table rows.

Returns:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/coradoc/asciidoc/model/table.rb', line 26

class Table < Base
  include Coradoc::AsciiDoc::Model::Anchorable

  def block_level?
    true
  end

  attribute :id, :string
  attribute :title, :string
  attribute :rows, Coradoc::AsciiDoc::Model::TableRow, collection: true
  attribute :content, :string
  # attribute :anchor, Inline::Anchor, default: -> {
  #   id.nil? ? nil : Inline::Anchor.new(id)
  # }
  attribute :attrs, Coradoc::AsciiDoc::Model::AttributeList
end

#titleString? (readonly)

Returns Optional table title.

Returns:

  • (String, nil)

    Optional table title



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/coradoc/asciidoc/model/table.rb', line 26

class Table < Base
  include Coradoc::AsciiDoc::Model::Anchorable

  def block_level?
    true
  end

  attribute :id, :string
  attribute :title, :string
  attribute :rows, Coradoc::AsciiDoc::Model::TableRow, collection: true
  attribute :content, :string
  # attribute :anchor, Inline::Anchor, default: -> {
  #   id.nil? ? nil : Inline::Anchor.new(id)
  # }
  attribute :attrs, Coradoc::AsciiDoc::Model::AttributeList
end

Instance Method Details

#block_level?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/coradoc/asciidoc/model/table.rb', line 29

def block_level?
  true
end