Class: OoxmlParser::ShapeStyle

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb

Overview

Class for parsing ‘wps:style` tags

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

#effect_referenceFillReference (readonly)

Returns effect reference.

Returns:

  • (FillReference)

    effect reference



9
10
11
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb', line 9

def effect_reference
  @effect_reference
end

#fill_referenceFillReference (readonly)

Returns fill reference.

Returns:

  • (FillReference)

    fill reference



11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb', line 11

def fill_reference
  @fill_reference
end

#font_referenceFontReference (readonly)

Returns font reference.

Returns:



13
14
15
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb', line 13

def font_reference
  @font_reference
end

#line_referenceLineReference (readonly)

Returns line reference.

Returns:

  • (LineReference)

    line reference



15
16
17
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb', line 15

def line_reference
  @line_reference
end

Instance Method Details

#parse(node) ⇒ ShapeStyle

Parse ShapeStyle object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb', line 20

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    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_reference = StyleMatrixReference.new(parent: self).parse(node_child)
    end
  end
  self
end