Class: OoxmlParser::ChartAxisTitle
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ChartAxisTitle
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb
Overview
Chart Axis Title ‘title` node
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#layout ⇒ Object
Returns the value of attribute layout.
-
#overlay ⇒ Object
Returns the value of attribute overlay.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ ChartAxisTitle
constructor
A new instance of ChartAxisTitle.
- #nil? ⇒ Boolean
-
#parse(node) ⇒ ChartAxisTitle
Parse ChartAxisTitle object.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ ChartAxisTitle
Returns a new instance of ChartAxisTitle.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 6 def initialize(parent: nil) @elements = [] @parent = parent end |
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 4 def elements @elements end |
#layout ⇒ Object
Returns the value of attribute layout.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 4 def layout @layout end |
#overlay ⇒ Object
Returns the value of attribute overlay.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 4 def @overlay end |
Instance Method Details
#nil? ⇒ Boolean
11 12 13 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 11 def nil? @layout.nil? && @overlay.nil? && @elements.empty? end |
#parse(node) ⇒ ChartAxisTitle
Parse ChartAxisTitle object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 18 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'tx' node_child.xpath('c:rich/*').each do |rich_node_child| case rich_node_child.name when 'p' Presentation.current_font_style = FontStyle.new(true) # Default font style for chart title always bold @elements << Paragraph.new(parent: self).parse(rich_node_child) Presentation.current_font_style = FontStyle.new end end when 'layout' @layout = option_enabled?(node_child) when 'overlay' @overlay = option_enabled?(node_child) end end self end |