class PureDocx::XmlGenerators::Row

Attributes

cells_width[R]

Public Class Methods

new(content, rels_constructor, arguments = {}) click to toggle source
Calls superclass method PureDocx::XmlGenerators::Base::new
# File lib/puredocx/xml_generators/row.rb, line 6
def initialize(content, rels_constructor, arguments = {})
  super(content, rels_constructor)
  @cells_width = arguments[:cells_width]
end

Public Instance Methods

params() click to toggle source
# File lib/puredocx/xml_generators/row.rb, line 15
def params
  { '{CELLS}' => cells }
end
template() click to toggle source
# File lib/puredocx/xml_generators/row.rb, line 11
def template
  File.read(DocArchive.template_path('table/rows.xml'))
end

Private Instance Methods

cells() click to toggle source
# File lib/puredocx/xml_generators/row.rb, line 21
def cells
  content.each_with_index.map do |cell_content, index|
    PureDocx::XmlGenerators::Cell.new(cell_content, nil, width: cells_width[index]).xml
  end.join
end