Method: Axlsx::Xf#to_xml_string

Defined in:
lib/axlsx/stylesheet/xf.rb

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Returns:

  • (String)


133
134
135
136
137
138
139
140
141
# File 'lib/axlsx/stylesheet/xf.rb', line 133

def to_xml_string(str = '')
  str << '<xf '
  h = instance_values.reject { |k, v| [:alignment, :protection, :extList, :name].include? k.to_sym}
  str << h.map { |key, value| '' << key.to_s << '="' << value.to_s << '"' }.join(' ')
  str << '>'
  alignment.to_xml_string(str) if self.alignment
  protection.to_xml_string(str) if self.protection
  str << '</xf>'
end