Class: RubyXL::DocumentProperties
- Inherits:
-
OOXMLObject
- Object
- OOXMLObject
- RubyXL::DocumentProperties
- Defined in:
- lib/rubyXL/objects/document_properties.rb
Overview
Instance Attribute Summary collapse
-
#workbook ⇒ Object
Returns the value of attribute workbook.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from OOXMLObject
#add_to_zip, define_attribute, define_child_node, define_element_name, #dup, #index_in_collection, #initialize, obtain_class_variable, parse, parse_file, set_countable, set_namespaces, #write_xml
Constructor Details
This class inherits a constructor from RubyXL::OOXMLObject
Instance Attribute Details
#workbook ⇒ Object
Returns the value of attribute workbook.
8 9 10 |
# File 'lib/rubyXL/objects/document_properties.rb', line 8 def workbook @workbook end |
Class Method Details
.filepath ⇒ Object
70 71 72 |
# File 'lib/rubyXL/objects/document_properties.rb', line 70 def self.filepath File.join('docProps', 'app.xml') end |
Instance Method Details
#add_part_title(name) ⇒ Object
48 49 50 |
# 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 ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# 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 |