Sha256: 20fbb82d11c2bddff11801365f2c271934e32ee2a2554c78c8ccf3d48b5d43fb
Contents?: true
Size: 864 Bytes
Versions: 11
Compression:
Stored size: 864 Bytes
Contents
require 'junoser/xsd/base' require 'junoser/xsd/enumeration' module Junoser module Xsd class Restriction include Base def children @children||= xml.xpath('./*[not(self::xsd:annotation or ' + 'self::xsd:minInclusive or self::xsd:maxInclusive or ' + 'self::xsd:minLength or self::xsd:maxLength)]') end def config @config ||= children.map {|child| case child.name when 'enumeration' Junoser::Xsd::Enumeration.new(child, depth: @depth+1) else raise "ERROR: unknown element: #{child.name}" end } end def to_s return format('arg') if config.empty? str = '(' + config.map {|c| c.to_s.strip }.join(' | ') + ')' format(str) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems