xsd_model 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xsd_model/elements/base_element.rb +32 -0
- data/lib/xsd_model/elements/element.rb +8 -0
- data/xsd_model.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 804d3f69f695bf3916304c9da3b0d8c443353b0e
|
4
|
+
data.tar.gz: e2370ef66bf2977e7dc4be65f01fe5b9010efd5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d0eb4bf82bba8439bfa36f847572a092f9dba3ecf449eeb697a6b28ea5a9dae7ca81dd711172eabdc7fc95062d1c2b7db9a7e2c4dd7291877b17b909e9c702d
|
7
|
+
data.tar.gz: 66748ca9aa4cbe7218d5f95ec658495b1fdb5a5bf38889369e7b0df923f0d570804ee5734a1be0db59512311102892ba336e479deef28403f30445aa2bec592a
|
@@ -20,6 +20,38 @@ module XsdModel
|
|
20
20
|
@namespaces = hashes[1] || {}
|
21
21
|
end
|
22
22
|
|
23
|
+
def xmlns_prefix
|
24
|
+
nil if xmlns_uri.nil?
|
25
|
+
|
26
|
+
ary = namespaces.to_a
|
27
|
+
|
28
|
+
candidates = ary.select do |n|
|
29
|
+
n[1] == xmlns_uri
|
30
|
+
end.map(&:first)
|
31
|
+
|
32
|
+
full_prefix = candidates.find do |c|
|
33
|
+
c.start_with? 'xmlns:'
|
34
|
+
end
|
35
|
+
|
36
|
+
full_prefix&.gsub('xmlns:', '')
|
37
|
+
end
|
38
|
+
|
39
|
+
def xmlns_uri
|
40
|
+
namespaces['xmlns']
|
41
|
+
end
|
42
|
+
|
43
|
+
def name_with_prefix
|
44
|
+
[xmlns_prefix, name].compact.join(':')
|
45
|
+
end
|
46
|
+
|
47
|
+
def type_with_prefix
|
48
|
+
if type&.include? ':'
|
49
|
+
type
|
50
|
+
else
|
51
|
+
[xmlns_prefix, type].compact.join(':')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
23
55
|
def xsd_prefix
|
24
56
|
namespaces.invert[XSD_URI].gsub('xmlns:', '')
|
25
57
|
end
|
data/xsd_model.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xsd_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Premysl Donat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|