Class: OoxmlParser::StyleParametres

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

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

#to_hash

Constructor Details

#initialize(name = nil, q_format = false, hidden = false, parent: nil) ⇒ StyleParametres

Returns a new instance of StyleParametres.



6
7
8
9
10
11
12
13
14
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb', line 6

def initialize(name = nil,
               q_format = false,
               hidden = false,
               parent: nil)
  @name = name
  @q_format = q_format
  @hidden = hidden
  @parent = parent
end

Instance Attribute Details

#hiddenObject

Returns the value of attribute hidden.



4
5
6
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb', line 4

def hidden
  @hidden
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb', line 4

def name
  @name
end

#q_formatObject

Returns the value of attribute q_format.



4
5
6
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb', line 4

def q_format
  @q_format
end

Instance Method Details

#parse(node) ⇒ StyleParametres

Parse StyleParametres data

Parameters:

  • node (Nokogiri::XML:Element)

    with StyleParametres data

Returns:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb', line 19

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'name'
      @name = node_child.attribute('val').value
    when 'qFormat'
      @q_format = option_enabled?(node_child)
    end
  end
  self
end