Class: OpenXml::Docx::Parts::Fonts
- Inherits:
-
Part
- Object
- Part
- OpenXml::Docx::Parts::Fonts
- Includes:
- RootNamespaces
- Defined in:
- lib/openxml/docx/parts/fonts.rb
Constant Summary
Constants included from RootNamespaces
RootNamespaces::POSSIBLE_NAMESPACES
Instance Attribute Summary collapse
-
#fonts ⇒ Object
readonly
Returns the value of attribute fonts.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
Instance Method Summary collapse
- #<<(font) ⇒ Object
- #count ⇒ Object
-
#initialize ⇒ Fonts
constructor
A new instance of Fonts.
- #to_xml ⇒ Object
Methods included from RootNamespaces
Constructor Details
Instance Attribute Details
#fonts ⇒ Object (readonly)
Returns the value of attribute fonts.
7 8 9 |
# File 'lib/openxml/docx/parts/fonts.rb', line 7 def fonts @fonts end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
7 8 9 |
# File 'lib/openxml/docx/parts/fonts.rb', line 7 def relationships @relationships end |
Instance Method Details
#<<(font) ⇒ Object
16 17 18 |
# File 'lib/openxml/docx/parts/fonts.rb', line 16 def <<(font) @fonts << font end |
#count ⇒ Object
20 21 22 |
# File 'lib/openxml/docx/parts/fonts.rb', line 20 def count fonts.count end |
#to_xml ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/openxml/docx/parts/fonts.rb', line 24 def to_xml build_standalone_xml do |xml| xml.fonts(root_namespaces) { xml.parent.namespace = :w fonts.each { |font| font.to_xml(xml) } } end end |