Sha256: d07eea2449610cedff56a3e6dc73e777a50cd698f29be26373c55bcb77eca4c7
Contents?: true
Size: 1.3 KB
Versions: 10
Compression:
Stored size: 1.3 KB
Contents
require 'berkeley_library/util/ods/xml/table/repeatable' require 'berkeley_library/util/ods/xml/text/p' module BerkeleyLibrary module Util module ODS module XML module Table class TableCell < Repeatable attr_reader :value attr_reader :cell_style 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 class << self def repeat_empty(number_repeated, cell_style = nil, table:) TableCell.new(nil, cell_style, number_repeated, table: table) end end private 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 def add_default_children! children << XML::Text::P.new(value, doc: doc) if value end end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems