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.
-
#parse(node) ⇒ ChartAxisTitle
Parse ChartAxisTitle object.
-
#visible? ⇒ Boolean
If chart title is visible.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ ChartAxisTitle
Returns a new instance of ChartAxisTitle.
8 9 10 11 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 8 def initialize(parent: nil) @elements = [] super end |
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 6 def elements @elements end |
#layout ⇒ Object
Returns the value of attribute layout.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 6 def layout @layout end |
#overlay ⇒ Object
Returns the value of attribute overlay.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 6 def @overlay end |
Instance Method Details
#parse(node) ⇒ ChartAxisTitle
Parse ChartAxisTitle object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 21 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' root_object.default_font_style = FontStyle.new(true) # Default font style for chart title always bold @elements << Paragraph.new(parent: self).parse(rich_node_child) root_object.default_font_style = FontStyle.new end end when 'layout' @layout = option_enabled?(node_child) when 'overlay' @overlay = option_enabled?(node_child) end end self end |
#visible? ⇒ Boolean
Returns if chart title is visible.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb', line 14 def visible? @layout || @overlay || !@elements.empty? end |