class BerkeleyLibrary::Util::ODS::XML::Table::TableCell

Attributes

cell_style[R]
value[R]

Public Class Methods

new(value = nil, cell_style = nil, number_repeated = 1, table:) click to toggle source
# File lib/berkeley_library/util/ods/xml/table/table_cell.rb, line 13
def initialize(value = nil, cell_style = nil, number_repeated = 1, table:)
  super('table-cell', 'number-columns-repeated', number_repeated, table: table)

  @value = value
  @cell_style = cell_style

  set_default_attributes!
  add_default_children!
end
repeat_empty(number_repeated, cell_style = nil, table:) click to toggle source
# File lib/berkeley_library/util/ods/xml/table/table_cell.rb, line 24
def repeat_empty(number_repeated, cell_style = nil, table:)
  TableCell.new(nil, cell_style, number_repeated, table: table)
end

Private Instance Methods

add_default_children!() click to toggle source
# File lib/berkeley_library/util/ods/xml/table/table_cell.rb, line 37
def add_default_children!
  children << XML::Text::P.new(value, doc: doc) if value
end
set_default_attributes!() click to toggle source
# File lib/berkeley_library/util/ods/xml/table/table_cell.rb, line 31
def set_default_attributes!
  set_attribute('style-name', cell_style.style_name) if cell_style
  set_attribute(:office, 'value-type', 'string') if value
  set_attribute(:calcext, 'value-type', 'string') if value
end