ooxml_parser 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba540828c5a8309f41774a4a3e8f2ab583191c861ae51f32a0a6fbfb92cf6d91
|
4
|
+
data.tar.gz: b747ef0164eb751ab889cb184025a1606794f0670aab618d2486a889c5d2f76a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc16c99a930f7a68016d099c293bc58672b345eb583d599c4b5ae885dfad705b42103b0f3f79d6604ccfb03b2eb8747f9b1663ea08ed04401002a7f4cdcd4eb7
|
7
|
+
data.tar.gz: 4824d4244130d1e120ea6cfffb0c34471aff1d9725a60e8fe27a2c5fc04826b5b325cbcfdaaab2f12e1016fdbf88b807adaaff5301ac1d91397358c2e17f6170
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
module OoxmlParser
|
2
2
|
# Class for parsing `w:w:sdtContent` tags
|
3
3
|
class SDTContent < OOXMLDocumentObject
|
4
|
-
# @return [Array, ParagraphRun]
|
5
|
-
attr_reader :
|
6
|
-
# @return [Array, ParagraphRun] paragraphs of sdt
|
7
|
-
attr_reader :paragraphs
|
4
|
+
# @return [Array <ParagraphRun, Table, ParagraphRun>] list of all elements in SDT
|
5
|
+
attr_reader :elements
|
8
6
|
|
9
7
|
def initialize(parent: nil)
|
10
|
-
@
|
11
|
-
@paragraphs = []
|
8
|
+
@elements = []
|
12
9
|
@parent = parent
|
13
10
|
end
|
14
11
|
|
@@ -19,12 +16,29 @@ module OoxmlParser
|
|
19
16
|
node.xpath('*').each do |node_child|
|
20
17
|
case node_child.name
|
21
18
|
when 'p'
|
22
|
-
@
|
19
|
+
@elements << DocxParagraph.new(parent: self).parse(node_child)
|
23
20
|
when 'r'
|
24
|
-
@
|
21
|
+
@elements << ParagraphRun.new(parent: self).parse(node_child)
|
22
|
+
when 'tbl'
|
23
|
+
@elements << Table.new(parent: self).parse(node_child)
|
25
24
|
end
|
26
25
|
end
|
27
26
|
self
|
28
27
|
end
|
28
|
+
|
29
|
+
# @return [Array<DocxParagraphs>] list of paragraphs
|
30
|
+
def paragraphs
|
31
|
+
@elements.select { |obj| obj.is_a?(OoxmlParser::DocxParagraph) }
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [Array<ParagraphRun>] list of runs
|
35
|
+
def runs
|
36
|
+
@elements.select { |obj| obj.is_a?(OoxmlParser::ParagraphRun) }
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [Array<Table>] list of tables
|
40
|
+
def tables
|
41
|
+
@elements.select { |obj| obj.is_a?(OoxmlParser::Table) }
|
42
|
+
end
|
29
43
|
end
|
30
44
|
end
|
data/lib/ooxml_parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ooxml_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Lobashov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-02-
|
12
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|