xsd 2.7.6 → 2.7.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c16048b771894d38405e3b63828e12ee144fc08195ea8000b4af88e54928a8a
4
- data.tar.gz: bffa90cda6f88776e90aff1e8beaaee1a6574ea98a871cb195fc5fd690873883
3
+ metadata.gz: ff502b7dd32ff1d77314572855fc2db9438ee569a6220851be791635fa4664cb
4
+ data.tar.gz: 1aeba68dcd5d4326f33575095d28b510d5102e54d01d7c0628c93bc2394344df
5
5
  SHA512:
6
- metadata.gz: 57f15db00816d658965e935e1a546df73dadf2e1efe0e388c0a7280fdd139d6a5daa6a6dac366ec7d50fb647afceb5bb0d931a1c598b8718f238c862198f7777
7
- data.tar.gz: 0a3606861353e20d98965bc4f197ed8e04f8613aa52588b88f10991ea2712ff8c9a8219d3da8f1361fd8a4cfb3be82b1ca1046a6f489cf5eeded5bbd934888d2
6
+ metadata.gz: 1edbc87c8c5316feb843063c90b09c87698cde273006c2b213cfb9d6241d6e82adba8d34819577c68858bb4d2fa399e9d6e7a2be4f90976f72c4fe471bf130b5
7
+ data.tar.gz: 5a49e3f2f2fe9027ad048bebe1eeef9cc782b72fb6ace9f19a8cbc41676b8fe455f1ff63d55cc4356745fcc436b5028349347525298c512a33ac51d6ebcabb2d
data/CHANGELOG.md CHANGED
@@ -1,10 +1,11 @@
1
- ## [2.7.6] - 2024-04-22
1
+ ## [2.7.8] - 2024-04-22
2
2
 
3
3
  - Return <xs:any> and <xs:anyAttribute> from collect_elements/collect_attributes
4
4
  - Make multiple_allowed? available on all definitions with max occurs
5
5
  - Don't return duplicated attributes from complex restriction
6
6
  - Fix base_complex_type on restriction without base
7
7
  - Improve substitutable elements detection
8
+ - Added mutiple? shorthand
8
9
 
9
10
  ## [2.6.3] - 2024-04-13
10
11
 
@@ -7,16 +7,7 @@ module XSD
7
7
  # extension (both simpleContent and complexContent)
8
8
  # https://www.w3schools.com/xml/el_all.asp
9
9
  class All < BaseObject
10
+ include MinMaxOccurs
10
11
  include ElementContainer
11
-
12
- # Optional. Specifies the minimum number of times the element can occur. The value can be 0 or 1. Default value is 1
13
- # @!attribute min_occurs
14
- # @return Integer
15
- property :minOccurs, :integer, default: 1
16
-
17
- # Optional. Specifies the maximum number of times the element can occur. The value must be 1.
18
- # @!attribute max_occurs
19
- # @return Integer
20
- property :maxOccurs, :integer, default: 1
21
12
  end
22
13
  end
@@ -45,6 +45,12 @@ module XSD
45
45
 
46
46
  # Determine if element may occur multiple times
47
47
  # @return Boolean
48
+ def multiple?
49
+ max_occurs == :unbounded || max_occurs > 1
50
+ end
51
+
52
+ # Determine if element may occur multiple times, accounting parents
53
+ # @return Boolean
48
54
  def multiple_allowed?
49
55
  computed_max_occurs == :unbounded || computed_max_occurs > 1
50
56
  end
data/lib/xsd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XSD
4
- VERSION = '2.7.6'
4
+ VERSION = '2.7.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.6
4
+ version: 2.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.arkhipov