File: element.rb

package info (click to toggle)
ruby-libxml 5.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,800 kB
  • sloc: xml: 18,263; ansic: 7,669; ruby: 5,809; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding: UTF-8

module LibXML
  module XML
    class Schema::Element
      def min_occurs
        @min
      end

      def max_occurs
        @max
      end

      def required?
        !min_occurs.zero?
      end

      def array?
        max_occurs > 1
      end

      def elements
        type.elements
      end
    end
  end
end