Sha256: 6353e15f58c402fcaa88e28cc684d38a594a857faba64fc10cf4faf71e047f02
Contents?: true
Size: 864 Bytes
Versions: 11
Compression:
Stored size: 864 Bytes
Contents
module Sablon module Processor class SectionProperties def self.from_document(document_xml) new document_xml.at_xpath(".//w:sectPr") end def initialize(properties_node) @properties_node = properties_node end def start_page_number pg_num_type && pg_num_type["w:start"] end def start_page_number=(number) find_or_add_pg_num_type["w:start"] = number end private def find_or_add_pg_num_type pg_num_type || begin node = Nokogiri::XML::Node.new "w:pgNumType", @properties_node.document @properties_node.children.after node node end end def pg_num_type @pg_num_type ||= @properties_node.at_xpath(".//w:pgNumType") end end end end
Version data entries
11 entries across 11 versions & 1 rubygems