Class: Writexlsx::Package::App

Inherits:
Object
  • Object
show all
Includes:
Utility
Defined in:
lib/write_xlsx/package/app.rb

Constant Summary

Constants included from Utility

Utility::COL_MAX, Utility::ROW_MAX, Utility::SHEETNAME_MAX, Utility::STR_MAX

Instance Method Summary collapse

Methods included from Utility

#absolute_char, #check_dimensions, #check_dimensions_and_update_max_min_values, #check_parameter, #convert_date_time, #dash_types, delete_files, #fill_properties, #float_to_str, #layout_properties, #line_fill_properties, #line_properties, #palette_color, #pixels_to_points, #ptrue?, #put_deprecate_message, #r_id_attributes, #row_col_notation, #shape_style_base, #store_col_max_min_values, #store_row_max_min_values, #substitute_cellref, #underline_attributes, #v_shape_attributes_base, #v_shape_style_base, #value_or_raise, #write_anchor, #write_auto_fill, #write_color, #write_comment_path, #write_div, #write_fill, #write_font, #write_stroke, #write_xml_declaration, #xl_cell_to_rowcol, #xl_col_to_name, #xl_range, #xl_range_formula, #xl_rowcol_to_cell, #xml_str

Constructor Details

#initializeApp

Returns a new instance of App.



11
12
13
14
15
16
# File 'lib/write_xlsx/package/app.rb', line 11

def initialize
  @writer = Package::XMLWriterSimple.new
  @part_names    = []
  @heading_pairs = []
  @properties    = {}
end

Instance Method Details

#add_heading_pair(heading_pair) ⇒ Object



44
45
46
47
48
# File 'lib/write_xlsx/package/app.rb', line 44

def add_heading_pair(heading_pair)
  return if heading_pair[1] == 0

  @heading_pairs.push(['lpstr', heading_pair[0]], ['i4', heading_pair[1]])
end

#add_part_name(part_name) ⇒ Object



40
41
42
# File 'lib/write_xlsx/package/app.rb', line 40

def add_part_name(part_name)
  @part_names.push(part_name)
end

#assemble_xml_fileObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/write_xlsx/package/app.rb', line 22

def assemble_xml_file
  write_xml_declaration do
    write_properties do
      write_application
      write_doc_security
      write_scale_crop
      write_heading_pairs
      write_titles_of_parts
      write_manager
      write_company
      write_links_up_to_date
      write_shared_doc
      write_hyperlinks_changed
      write_app_version
    end
  end
end

#set_properties(properties) ⇒ Object

Set the document properties.



53
54
55
# File 'lib/write_xlsx/package/app.rb', line 53

def set_properties(properties)
  @properties = properties
end

#set_xml_writer(filename) ⇒ Object



18
19
20
# File 'lib/write_xlsx/package/app.rb', line 18

def set_xml_writer(filename)
  @writer.set_xml_writer(filename)
end