class Odf::Element::TableCell

Constants

TYPE_MAP
VALID_OPTIONS
XML_TAG

Public Class Methods

build(parent, content, options = {}) click to toggle source
# File lib/odf/element/table_cell.rb, line 13
def self.build(parent, content, options = {})
  type      = options[:type] || infer_type(content)
  self_opts = {
      'office:value-type' => type,
      'office:value' => content
    }.merge(options)
  this = new(parent, self_opts)

  Odf::Element::Paragraph.build(this, content, options)
  this
end
infer_type(content) click to toggle source
# File lib/odf/element/table_cell.rb, line 25
def self.infer_type(content)
  TYPE_MAP[content.class] || 'string'
end