Sha256: b2239ecd142d41b542b3703ab0b7ce8d1ec3f8a8b9484668517108f7039ecbc4

Contents?: true

Size: 490 Bytes

Versions: 10

Compression:

Stored size: 490 Bytes

Contents

require 'junoser/xsd/base'

module Junoser
  module Xsd
    class Enumeration
      include Base

      def initialize(xml, options={})
        super
      end

      def config
        raise "ERROR: unknown Enumeration format" if children.size > 1

        has_match? ? 'arg' : %["#{xml['value']}"]
      end

      def to_s
        format(OFFSET + config)
      end


      private

      def has_match?
        return true unless xml.xpath('.//match').empty?
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
junoser-0.2.2 lib/junoser/xsd/enumeration.rb
junoser-0.2.1 lib/junoser/xsd/enumeration.rb
junoser-0.2.0 lib/junoser/xsd/enumeration.rb
junoser-0.1.6 lib/junoser/xsd/enumeration.rb
junoser-0.1.5 lib/junoser/xsd/enumeration.rb
junoser-0.1.4 lib/junoser/xsd/enumeration.rb
junoser-0.1.3 lib/junoser/xsd/enumeration.rb
junoser-0.1.2 lib/junoser/xsd/enumeration.rb
junoser-0.1.1 lib/junoser/xsd/enumeration.rb
junoser-0.1.0 lib/junoser/xsd/enumeration.rb