Class: RubyXL::Text

Inherits:
OOXMLObject show all
Defined in:
lib/rubyXL/objects/text.rb

Overview

Instance Method Summary collapse

Methods included from OOXMLObjectClassMethods

#define_attribute, #define_child_node, #define_element_name, #obtain_class_variable, #parse, #set_countable

Methods included from OOXMLObjectInstanceMethods

#dup, #index_in_collection, #initialize, #write_xml

Instance Method Details

#before_write_xmlObject



13
14
15
16
# File 'lib/rubyXL/objects/text.rb', line 13

def before_write_xml
  self.xml_space = (value && ((value =~ /^\s/) || (value =~ /\s$/)) || value.include?("\n")) ? 'preserve' : nil
  true
end

#to_sObject



18
19
20
# File 'lib/rubyXL/objects/text.rb', line 18

def to_s
  value.to_s
end