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



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

def config
  @config ||= children.map {|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

#to_sObject



19
20
21
# File 'lib/junoser/xsd/union.rb', line 19

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