Sha256: 97af3fcb171d040d5f1da7706ec524df1e5f6534676210343f7fdf16c836cff9

Contents?: true

Size: 582 Bytes

Versions: 30

Compression:

Stored size: 582 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
        if nokeyword?
          format(OFFSET + 'arg')
        else
          format(OFFSET + config.first)
        end
      end


      private

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

Version data entries

30 entries across 30 versions & 1 rubygems

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