class RubyXL::DocumentProperties

www.schemacentral.com/sc/ooxml/e-extended-properties_Properties.html

Attributes

workbook[RW]

Public Class Methods

content_type() click to toggle source
# File lib/rubyXL/objects/document_properties.rb, line 74
def self.content_type
  'application/vnd.openxmlformats-officedocument.extended-properties+xml'
end
xlsx_path() click to toggle source
# File lib/rubyXL/objects/document_properties.rb, line 70
def self.xlsx_path
  File.join('docProps', 'app.xml')
end

Public Instance Methods

add_part_title(name) click to toggle source
# File lib/rubyXL/objects/document_properties.rb, line 48
def add_part_title(name)
  titles_of_parts.vt_vector.vt_lpstr << RubyXL::StringNode.new(:value => name)
end
before_write_xml() click to toggle source
# File lib/rubyXL/objects/document_properties.rb, line 53
def before_write_xml
  if @workbook then
    self.heading_pairs = RubyXL::VectorValue.new(:vt_vector => RubyXL::Vector.new(:base_type => 'variant'))
    self.titles_of_parts = RubyXL::VectorValue.new(:vt_vector => RubyXL::Vector.new(:base_type => 'lpstr'))

    add_parts_count('Worksheets', @workbook.worksheets.size)
    @workbook.worksheets.each { |sheet| add_part_title(sheet.sheet_name) }

    if @workbook.defined_name_container then
      add_parts_count('Named Ranges', @workbook.defined_name_container.defined_names.size)
      @workbook.defined_name_container.defined_names.each { |defined_name| add_part_title(defined_name.name) }
    end
  end

  true
end