Class: BerkeleyLibrary::Util::ODS::XML::Table::TableCell

Inherits:
Repeatable show all
Defined in:
lib/berkeley_library/util/ods/xml/table/table_cell.rb

Instance Attribute Summary collapse

Attributes inherited from Repeatable

#attr_name_num_repeated, #number_repeated, #table

Attributes inherited from ElementNode

#doc, #element_name, #namespace

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Repeatable

#increment_repeats!

Methods inherited from ElementNode

#add_child, #attributes, #children, #clear_attribute, #create_element, #element, #ensure_element!, #prefix, #prefixed_attr_name, #set_attribute

Constructor Details

#initialize(value = nil, cell_style = nil, number_repeated = 1, table:) ⇒ TableCell

Returns a new instance of TableCell.



13
14
15
16
17
18
19
20
21
# 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

Instance Attribute Details

#cell_styleObject (readonly)

Returns the value of attribute cell_style.



11
12
13
# File 'lib/berkeley_library/util/ods/xml/table/table_cell.rb', line 11

def cell_style
  @cell_style
end

#valueObject (readonly)

Returns the value of attribute value.



10
11
12
# File 'lib/berkeley_library/util/ods/xml/table/table_cell.rb', line 10

def value
  @value
end

Class Method Details

.repeat_empty(number_repeated, cell_style = nil, table:) ⇒ Object



24
25
26
# 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