Sha256: 859036ede71cc85f54917aae59ad825dec37ae0173ce8c96052e7cb2ee02fc15

Contents?: true

Size: 613 Bytes

Versions: 13

Compression:

Stored size: 613 Bytes

Contents

require 'junoser/xsd/base'
require 'junoser/xsd/restriction'
require 'junoser/xsd/union'

module Junoser
  module Xsd
    class SimpleType
      include Base

      def config
        @config ||= children.map {|child|
          case child.name
          when 'restriction'
            Junoser::Xsd::Restriction.new(child, depth: @depth+1)
          when 'union'
            Junoser::Xsd::Union.new(child, depth: @depth+1)
          else
            raise "ERROR: unknown element: #{child.name}"
          end
        }
      end

      def to_s
        format(config.first.to_s.strip)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
junoser-0.3.12 lib/junoser/xsd/simple_type.rb
junoser-0.3.11 lib/junoser/xsd/simple_type.rb
junoser-0.3.10 lib/junoser/xsd/simple_type.rb
junoser-0.3.9 lib/junoser/xsd/simple_type.rb
junoser-0.3.8 lib/junoser/xsd/simple_type.rb
junoser-0.3.7 lib/junoser/xsd/simple_type.rb
junoser-0.3.6 lib/junoser/xsd/simple_type.rb
junoser-0.3.5 lib/junoser/xsd/simple_type.rb
junoser-0.3.4 lib/junoser/xsd/simple_type.rb
junoser-0.3.3 lib/junoser/xsd/simple_type.rb
junoser-0.3.2 lib/junoser/xsd/simple_type.rb
junoser-0.3.1 lib/junoser/xsd/simple_type.rb
junoser-0.3.0 lib/junoser/xsd/simple_type.rb