Class: OoxmlParser::ChartStyleEntry

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb

Overview

Class for parsing Chart Style entry

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#body_propertiesOOXMLShapeBodyProperties (readonly)

Returns body properties.

Returns:



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 7

def body_properties
  @body_properties
end

#default_run_propertiesRunProperties (readonly)

Returns default run properties.

Returns:



9
10
11
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 9

def default_run_properties
  @default_run_properties
end

#effect_referenceFillReference (readonly)

Returns effect reference.

Returns:

  • (FillReference)

    effect reference



11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 11

def effect_reference
  @effect_reference
end

#fill_referenceFillReference (readonly)

Returns fill reference.

Returns:

  • (FillReference)

    fill reference



13
14
15
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 13

def fill_reference
  @fill_reference
end

#font_referenceFontReference (readonly)

Returns font reference.

Returns:



15
16
17
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 15

def font_reference
  @font_reference
end

#line_style_referenceStyleMatrixReference (readonly)

Returns line style reference.

Returns:



17
18
19
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 17

def line_style_reference
  @line_style_reference
end

#shape_propertiesStyleMatrixReference (readonly)

Returns shape properties.

Returns:



19
20
21
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 19

def shape_properties
  @shape_properties
end

Instance Method Details

#parse(node) ⇒ ChartStyleEntry

Parse Chart style entry

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/chart_style_file/chart_style_entry.rb', line 24

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'bodyPr'
      @body_properties = OOXMLShapeBodyProperties.new(parent: self).parse(node_child)
    when 'defRPr'
      @default_run_properties = RunProperties.new(parent: self).parse(node_child)
    when 'effectRef'
      @effect_reference = StyleMatrixReference.new(parent: self).parse(node_child)
    when 'fillRef'
      @fill_reference = StyleMatrixReference.new(parent: self).parse(node_child)
    when 'fontRef'
      @font_reference = FontReference.new(parent: self).parse(node_child)
    when 'lnRef'
      @line_style_reference = StyleMatrixReference.new(parent: self).parse(node_child)
    when 'spPr'
      @shape_properties = DocxShapeProperties.new(parent: self).parse(node_child)
    end
  end
  self
end