class MsDocx::Paragraph

@author Alex Mercury

Public Class Methods

new(xml_element) click to toggle source

Nokogiri::XML::Element

# File lib/ms_docx/paragraph.rb, line 6
def initialize(xml_element)
  @xml_element = xml_element
end

Public Instance Methods

text() click to toggle source
# File lib/ms_docx/paragraph.rb, line 14
def text
  @xml_element.xpath(@xml_element.path + '//w:r//w:t').map(&:content).join('')
end
text=(value) click to toggle source
# File lib/ms_docx/paragraph.rb, line 19
def text=(value)

  text_node = @xml_element.xpath(@xml_element.path + '//w:r//w:t').first
  text_node.content = value if text_node

end
to_xml() click to toggle source
# File lib/ms_docx/paragraph.rb, line 10
def to_xml
  @xml_element.to_xml
end