Class: Goldendocx::Tables::Row

Inherits:
Object
  • Object
show all
Includes:
Element
Defined in:
lib/goldendocx/tables/row.rb

Direct Known Subclasses

HeaderRow

Instance Method Summary collapse

Methods included from Element

#build_element, #initialize, #namespace, #tag, #tag_name, #to_element, #to_xml

Methods included from HasChildren

#children, #read_child, #read_children

Methods included from HasAttributes

#assign_attributes, #attributes, #read_attributes

Instance Method Details

#add_cell(data) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/goldendocx/tables/row.rb', line 18

def add_cell(data)
  cell = case data
         when Goldendocx::Tables::Cell then data
         when Hash then Goldendocx::Tables::Cell.new(**data)
         else Goldendocx::Tables::Cell.new(content: data.to_s)
         end
  cells << cell
end

#height=(height) ⇒ Object



14
15
16
# File 'lib/goldendocx/tables/row.rb', line 14

def height=(height)
  row_property.height.height = height if height
end