Class: OoxmlParser::FontScheme
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::FontScheme
- Defined in:
- lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme.rb
Overview
Class for parsing ‘fontScheme` tag
Instance Attribute Summary collapse
-
#major_font ⇒ FontCollection
readonly
Major font data.
-
#minor_font ⇒ FontCollection
readonly
Minor font data.
-
#name ⇒ String
readonly
Name of font.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ FontScheme
Parse FontScheme object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#major_font ⇒ FontCollection (readonly)
Returns major font data.
10 11 12 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme.rb', line 10 def major_font @major_font end |
#minor_font ⇒ FontCollection (readonly)
Returns minor font data.
12 13 14 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme.rb', line 12 def minor_font @minor_font end |
#name ⇒ String (readonly)
Returns name of font.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme.rb', line 8 def name @name end |
Instance Method Details
#parse(node) ⇒ FontScheme
Parse FontScheme object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme.rb', line 17 def parse(node) node.attributes.each do |key, value| case key when 'name' @name = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'majorFont' @major_font = FontCollection.new(parent: self).parse(node_child) when 'minorFont' @minor_font = FontCollection.new(parent: self).parse(node_child) end end self end |