Class: DocxReport::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/docx_report/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ Parser

Returns a new instance of Parser.



5
6
7
# File 'lib/docx_report/parser.rb', line 5

def initialize(document)
  @document = document
end

Instance Method Details

#fill_all_tables(tables) ⇒ Object



17
18
19
20
21
# File 'lib/docx_report/parser.rb', line 17

def fill_all_tables(tables)
  @document.files.each do |file|
    fill_tables(tables, file.xml, file)
  end
end

#replace_all_fields(fields) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/docx_report/parser.rb', line 9

def replace_all_fields(fields)
  @document.files.each do |file|
    replace_node_fields(fields, file.xml)
    replace_node_hyperlinks(fields, file.xml, file)
    replace_node_images(fields, file.xml, file)
  end
end