Sha256: 1ef06ee3f3556715fb158ef730b334d93bb76da9a976bfc6a5094b857f41ceea
Contents?: true
Size: 809 Bytes
Versions: 10
Compression:
Stored size: 809 Bytes
Contents
require 'junoser/xsd/base' require 'junoser/xsd/element' module Junoser module Xsd class Choice include Base def config @config ||= children.map {|child| case child.name when 'element' Junoser::Xsd::Element.new(child, depth: @depth+1) when 'choice' Junoser::Xsd::Choice.new(child, depth: @depth+1) else raise "ERROR: unknown element: #{child.name}" end }.compact end def to_s case when config.empty? when has_single_child_of?(Junoser::Xsd::Choice) format('c(', config.first.config.map(&:to_s).compact.join(",\n"), ')') else format('c(', config.map(&:to_s).compact.join(",\n"), ')') end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems