class Sablon::Processor::SectionProperties
Public Class Methods
new(xml_node)
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 9 def initialize(xml_node) @properties_node = xml_node.at_xpath(".//w:sectPr") end
process(xml_node, env)
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 4 def self.process(xml_node, env) processor = new(xml_node) processor.write_properties(env.section_properties) end
Public Instance Methods
start_page_number()
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 18 def start_page_number pg_num_type && pg_num_type["w:start"] end
start_page_number=(number)
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 22 def start_page_number=(number) find_or_add_pg_num_type["w:start"] = number end
write_properties(properties = {})
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 13 def write_properties(properties = {}) return unless properties["start_page_number"] self.start_page_number = properties["start_page_number"] end
Private Instance Methods
find_or_add_pg_num_type()
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 28 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
pg_num_type()
click to toggle source
# File lib/sablon/processor/section_properties.rb, line 36 def pg_num_type @pg_num_type ||= @properties_node.at_xpath(".//w:pgNumType") end