xsd 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/xsd/base_object.rb +18 -14
- data/lib/xsd/objects/attribute.rb +3 -4
- data/lib/xsd/objects/element.rb +1 -1
- data/lib/xsd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3f894631bb4ecfab0ab93c8b67f1a4d2d85dc88aeef5c69890e424c018ea7a0
|
4
|
+
data.tar.gz: 6be2dfdee0a06f955d80ba57cbc39739fa6c09c06d6af80d194e77ccf32c8797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d45a0c77011c0bdfd4bdee3998eef649129cb51d2c248b733a35b9c2c19bb8678b2b41035afcc95f69f02e37df550bd90ef5c57a03225789de34ff7dfb65c11
|
7
|
+
data.tar.gz: dd2673d5e862524a8fad13f8ce55857d9ec3c7daed215542b9806491c428e778ce011b77c26f2dc3aa6ba24a60bfd5d1bdf9ed6cc59a702ac4daa23725fa9dce
|
data/CHANGELOG.md
CHANGED
data/lib/xsd/base_object.rb
CHANGED
@@ -304,20 +304,24 @@ module XSD
|
|
304
304
|
# check for property first
|
305
305
|
if (property = self.class.properties[method])
|
306
306
|
value = property[:resolve] ? property[:resolve].call(self) : node[property[:name].to_s]
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
307
|
+
r = if value.nil?
|
308
|
+
if node['ref']
|
309
|
+
# if object has reference - search property in referenced object
|
310
|
+
reference.send(method, *args)
|
311
|
+
else
|
312
|
+
property[:default].is_a?(Proc) ? instance_eval(&property[:default]) : property[:default]
|
313
|
+
end
|
314
|
+
else
|
315
|
+
case property[:type]
|
316
|
+
when :integer
|
317
|
+
property[:name] == :maxOccurs && value == 'unbounded' ? :unbounded : value.to_i
|
318
|
+
when :boolean
|
319
|
+
value == 'true'
|
320
|
+
else
|
321
|
+
value
|
322
|
+
end
|
323
|
+
end
|
324
|
+
return @cache[method] = r
|
321
325
|
end
|
322
326
|
|
323
327
|
# if object has ref it cannot contain any type and children, so proxy call to target object
|
@@ -28,15 +28,14 @@ module XSD
|
|
28
28
|
property :fixed, :string
|
29
29
|
|
30
30
|
# Optional. Specifies the form for the attribute. The default value is the value of the attributeFormDefault
|
31
|
-
# attribute of the
|
31
|
+
# attribute of the schema containing the attribute. Can be set to one of the following:
|
32
32
|
# qualified - indicates that this attribute must be qualified with the namespace prefix and the no-colon-name
|
33
33
|
# (NCName) of the attribute
|
34
34
|
# unqualified - indicates that this attribute is not required to be qualified with the namespace prefix and is
|
35
35
|
# matched against the (NCName) of the attribute
|
36
36
|
# @!attribute form
|
37
|
-
# @return String
|
38
|
-
|
39
|
-
property :form, :string
|
37
|
+
# @return String
|
38
|
+
property :form, :string, default: proc { schema.attribute_form_default }
|
40
39
|
|
41
40
|
# Optional. Specifies a built-in data type or a simple type. The type attribute can only be present when the
|
42
41
|
# content does not contain a simpleType element
|
data/lib/xsd/objects/element.rb
CHANGED
@@ -47,7 +47,7 @@ module XSD
|
|
47
47
|
# cannot be used if the parent element is the schema element
|
48
48
|
# @!attribute form
|
49
49
|
# @return String
|
50
|
-
property :form, :string
|
50
|
+
property :form, :string, default: proc { schema.element_form_default }
|
51
51
|
|
52
52
|
# Optional. Specifies whether an explicit null value can be assigned to the element. True enables an instance of
|
53
53
|
# the element to have the null attribute set to true. The null attribute is defined as part of the XML Schema
|
data/lib/xsd/version.rb
CHANGED