Class: Junoser::Xsd::Union

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/junoser/xsd/union.rb

Constant Summary

Constants included from Base

Base::OFFSET

Instance Attribute Summary

Attributes included from Base

#parent, #xml

Instance Method Summary collapse

Methods included from Base

#children, #initialize, #inspect, #oneliner?, #root?

Instance Method Details

#configObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/junoser/xsd/union.rb', line 10

def config
  @config ||= children.map do |child|
    case child.name
    when 'simpleType'
      Junoser::Xsd::SimpleType.new(child, depth: @depth + 1, parent: self)
    else
      raise "ERROR: unknown element: #{child.name}"
    end
  end
end

#to_sObject



21
22
23
# File 'lib/junoser/xsd/union.rb', line 21

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