Sha256: 8a39da8c687dabe5a8f90ceb3044e95f928ec9de0e83998b4d03ac91a562e841

Contents?: true

Size: 641 Bytes

Versions: 17

Compression:

Stored size: 641 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, parent: self)
          when 'union'
            Junoser::Xsd::Union.new(child, depth: @depth+1, parent: self)
          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

17 entries across 17 versions & 1 rubygems

Version Path
junoser-0.6.0 lib/junoser/xsd/simple_type.rb
junoser-0.5.6 lib/junoser/xsd/simple_type.rb
junoser-0.5.5 lib/junoser/xsd/simple_type.rb
junoser-0.5.4 lib/junoser/xsd/simple_type.rb
junoser-0.5.3 lib/junoser/xsd/simple_type.rb
junoser-0.5.2 lib/junoser/xsd/simple_type.rb
junoser-0.5.1 lib/junoser/xsd/simple_type.rb
junoser-0.5.0 lib/junoser/xsd/simple_type.rb
junoser-0.4.7 lib/junoser/xsd/simple_type.rb
junoser-0.4.6 lib/junoser/xsd/simple_type.rb
junoser-0.4.5 lib/junoser/xsd/simple_type.rb
junoser-0.4.4 lib/junoser/xsd/simple_type.rb
junoser-0.4.3 lib/junoser/xsd/simple_type.rb
junoser-0.4.2 lib/junoser/xsd/simple_type.rb
junoser-0.4.1 lib/junoser/xsd/simple_type.rb
junoser-0.4.0 lib/junoser/xsd/simple_type.rb
junoser-0.3.13 lib/junoser/xsd/simple_type.rb