class ODFWriter::SectionReader
SectionReader: find all sections and set name
Attributes
name[RW]
Public Class Methods
new(opts)
click to toggle source
initialize
# File lib/odf_writer/section_reader.rb, line 38 def initialize(opts) @name = opts[:name] end
Public Instance Methods
nodes( doc )
click to toggle source
nodes
# File lib/odf_writer/section_reader.rb, line 56 def nodes( doc ) doc.xpath(".//text:section").map{|node| [node.attr("text:name"), node] }.to_h end
sections( doc )
click to toggle source
sections
# File lib/odf_writer/section_reader.rb, line 47 def sections( doc ) nodes( doc ).keys end