Class: Xlsxrb::Elements::RichText

Inherits:
Data
  • Object
show all
Defined in:
lib/xlsxrb/elements/types.rb

Overview

Represents a rich text string with formatting runs. runs: array of hashes, each with :text and optional :font (hash of font properties). Font properties: :bold, :italic, :underline, :sz, :color, :name

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#runsObject (readonly)

Returns the value of attribute runs

Returns:

  • (Object)

    the current value of runs



30
31
32
# File 'lib/xlsxrb/elements/types.rb', line 30

def runs
  @runs
end

Instance Method Details

#to_sObject



31
32
33
# File 'lib/xlsxrb/elements/types.rb', line 31

def to_s
  runs.map { |r| r[:text] }.join
end