class Axlsx::RichText

A simple, self serializing class for storing TextRuns

def add_run(text, options = {})

Parameters:
  • options (Object) -- The options to use in creating the new RichTextRun
  • text (String) -- The text to use in creating a new RichTextRun
def add_run(text, options = {})
  self << RichTextRun.new(text, options)
end

def autowidth

Returns:
  • (Number) -
def autowidth
  widtharray = [0] # Are arrays the best way of solving this problem?
  each { |run| run.autowidth(widtharray) }
  widtharray.max
end

def cell=(cell)

Parameters:
  • cell (Cell) -- The cell which all RichTextRuns in the collection will belong to
def cell=(cell)
  @cell = cell
  each { |run| run.cell = cell }
end

def initialize(text = nil, options = {})

Other tags:
    Yield: - self

Parameters:
  • options (Object) -- -optional The options to use in creating the first RichTextRun
  • text (String) -- -optional The text to use in creating the first RichTextRun
def initialize(text = nil, options = {})
  super(RichTextRun)
  add_run(text, options) unless text.nil?
  yield self if block_given?
end

def runs

Returns:
  • (RichText) -
def runs
  self
end

def to_xml_string(str = '')

Returns:
  • (String) -

Parameters:
  • str (String) --
def to_xml_string(str = '')
  each { |run| run.to_xml_string(str) }
  str
end