Class: Axlsx::App

Inherits:
Object
  • Object
show all
Defined in:
lib/axlsx/doc_props/app.rb

Overview

Note:

Support is not implemented for the following complex types:

HeadingPairs (VectorVariant), TitlesOfParts (VectorLpstr), HLinks (VectorVariant), DigSig (DigSigBlob)

App represents the app.xml document. The attributes for this object are primarily managed by the application the end user uses to edit the document. None of the attributes are required to serialize a valid xlsx object.

See Also:

  • shared-documentPropertiesExtendedshared-documentPropertiesExtended.xsd

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ App

Creates an App object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • template (String)
  • manager (String)
  • pages (Integer)
  • words (Integer)
  • characters (Integer)
  • presentation_format (String)
  • lines (Integer)
  • paragraphs (Integer)
  • slides (Integer)
  • notes (Integer)
  • total_time (Integer)
  • hidden_slides (Integer)
  • m_m_clips (Integer)
  • scale_crop (Boolean)
  • links_up_to_date (Boolean)
  • characters_with_spaces (Integer)
  • share_doc (Boolean)
  • hyperlink_base (String)
  • hyperlinks_changed (String)
  • application (String)
  • app_version (String)
  • doc_security (Integer)


128
129
130
131
132
# File 'lib/axlsx/doc_props/app.rb', line 128

def initialize(options={})
  options.each do |o|
    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  end
end

Instance Attribute Details

#app_versionString Also known as: AppVersion

Returns The version of the application.

Returns:

  • (String)

    The version of the application.



98
99
100
# File 'lib/axlsx/doc_props/app.rb', line 98

def app_version
  @app_version
end

#applicationString (readonly) Also known as: Applicatoin

Returns The name of the application.

Returns:

  • (String)

    The name of the application



94
95
96
# File 'lib/axlsx/doc_props/app.rb', line 94

def application
  @application
end

#charactersInteger Also known as: Characters

Returns The number of characters in the document.

Returns:

  • (Integer)

    The number of characters in the document.



34
35
36
# File 'lib/axlsx/doc_props/app.rb', line 34

def characters
  @characters
end

#characters_with_spacesInteger Also known as: CharactersWithSpaces

Returns The number of characters in the document including spaces.

Returns:

  • (Integer)

    The number of characters in the document including spaces.



78
79
80
# File 'lib/axlsx/doc_props/app.rb', line 78

def characters_with_spaces
  @characters_with_spaces
end

#companyString Also known as: Company

Returns The name of the company generating the document.

Returns:

  • (String)

    The name of the company generating the document.



22
23
24
# File 'lib/axlsx/doc_props/app.rb', line 22

def company
  @company
end

#doc_securityInteger Also known as: DocSecurity

Returns Document security.

Returns:

  • (Integer)

    Document security



102
103
104
# File 'lib/axlsx/doc_props/app.rb', line 102

def doc_security
  @doc_security
end

#hidden_slidesInteger Also known as: HiddenSlides

Returns The number of hidden slides.

Returns:

  • (Integer)

    The number of hidden slides.



62
63
64
# File 'lib/axlsx/doc_props/app.rb', line 62

def hidden_slides
  @hidden_slides
end

Returns The base for hyper links in the document.

Returns:

  • (String)

    The base for hyper links in the document.



86
87
88
# File 'lib/axlsx/doc_props/app.rb', line 86

def hyperlink_base
  @hyperlink_base
end

Returns Indicates that the hyper links in the document have been changed.

Returns:

  • (Boolean)

    Indicates that the hyper links in the document have been changed.



90
91
92
# File 'lib/axlsx/doc_props/app.rb', line 90

def hyperlinks_changed
  @hyperlinks_changed
end

#linesInteger Also known as: Lines

Returns The number of lines in the document.

Returns:

  • (Integer)

    The number of lines in the document.



42
43
44
# File 'lib/axlsx/doc_props/app.rb', line 42

def lines
  @lines
end

Returns The links in the document are up to date.

Returns:

  • (Boolean)

    The links in the document are up to date.



74
75
76
# File 'lib/axlsx/doc_props/app.rb', line 74

def links_up_to_date
  @links_up_to_date
end

#m_m_clipsInteger Also known as: MMClips

Returns The total number multimedia clips.

Returns:

  • (Integer)

    The total number multimedia clips



66
67
68
# File 'lib/axlsx/doc_props/app.rb', line 66

def m_m_clips
  @m_m_clips
end

#managerString Also known as: Manager

Returns The name of the manager for the document.

Returns:

  • (String)

    The name of the manager for the document.



18
19
20
# File 'lib/axlsx/doc_props/app.rb', line 18

def manager
  @manager
end

#notesInteger Also known as: Notes

Returns The number of slides that have notes.

Returns:

  • (Integer)

    The number of slides that have notes.



54
55
56
# File 'lib/axlsx/doc_props/app.rb', line 54

def notes
  @notes
end

#pagesInteger Also known as: Pages

Returns The number of pages in the document.

Returns:

  • (Integer)

    The number of pages in the document.



26
27
28
# File 'lib/axlsx/doc_props/app.rb', line 26

def pages
  @pages
end

#paragraphsInteger Also known as: Paragraphs

Returns The number of paragraphs in the document.

Returns:

  • (Integer)

    The number of paragraphs in the document



46
47
48
# File 'lib/axlsx/doc_props/app.rb', line 46

def paragraphs
  @paragraphs
end

#presentation_formatString Also known as: PresentationFormat

Returns The intended format of the presentation.

Returns:

  • (String)

    The intended format of the presentation.



38
39
40
# File 'lib/axlsx/doc_props/app.rb', line 38

def presentation_format
  @presentation_format
end

#scale_cropBoolean Also known as: ScaleCrop

Returns The display mode for the document thumbnail.

Returns:

  • (Boolean)

    The display mode for the document thumbnail.



70
71
72
# File 'lib/axlsx/doc_props/app.rb', line 70

def scale_crop
  @scale_crop
end

#shared_docBoolean Also known as: SharedDoc

Returns Indicates if the document is shared.

Returns:

  • (Boolean)

    Indicates if the document is shared.



82
83
84
# File 'lib/axlsx/doc_props/app.rb', line 82

def shared_doc
  @shared_doc
end

#slidesIntger Also known as: Slides

Returns The number of slides in the document.

Returns:

  • (Intger)

    The number of slides in the document.



50
51
52
# File 'lib/axlsx/doc_props/app.rb', line 50

def slides
  @slides
end

#templateString Also known as: Template

Returns The name of the document template.

Returns:

  • (String)

    The name of the document template.



14
15
16
# File 'lib/axlsx/doc_props/app.rb', line 14

def template
  @template
end

#total_timeInteger Also known as: TotalTime

Returns The total amount of time spent editing.

Returns:

  • (Integer)

    The total amount of time spent editing.



58
59
60
# File 'lib/axlsx/doc_props/app.rb', line 58

def total_time
  @total_time
end

#wordsInteger Also known as: Words

Returns The number of words in the document.

Returns:

  • (Integer)

    The number of words in the document.



30
31
32
# File 'lib/axlsx/doc_props/app.rb', line 30

def words
  @words
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serialize the app.xml document

Returns:

  • (String)


220
221
222
223
224
225
# File 'lib/axlsx/doc_props/app.rb', line 220

def to_xml_string(str = '')
  str << '<?xml version="1.0" encoding="UTF-8"?>'
  str << '<Properties xmlns="' << APP_NS << '" xmlns:vt="' << APP_NS_VT << '">'
  str << instance_values.map { |key, value| '<' << Axlsx.camel(key) << '>' << value.to_s << '</' << Axlsx.camel(key) << '>' }.join
  str << '</Properties>'
end