Class WSDL::XMLSchema::Content
In: lib/wsdl/xmlSchema/content.rb
Parent: Info

Methods

Attributes

contents  [R] 
elements  [R] 
final  [RW] 
mixed  [RW] 
type  [RW] 

Public Class methods

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 23
23:   def initialize
24:     super()
25:     @final = nil
26:     @mixed = false
27:     @type = nil
28:     @contents = []
29:     @elements = []
30:   end

Public Instance methods

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 36
36:   def <<(content)
37:     @contents << content
38:     update_elements
39:   end

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 41
41:   def each
42:     @contents.each do |content|
43:       yield content
44:     end
45:   end

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 67
67:   def parse_attr(attr, value)
68:     case attr
69:     when FinalAttrName
70:       @final = value.source
71:     when MixedAttrName
72:       @mixed = (value.source == 'true')
73:     else
74:       nil
75:     end
76:   end

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 47
47:   def parse_element(element)
48:     case element
49:     when AllName, SequenceName, ChoiceName
50:       o = Content.new
51:       o.type = element.name
52:       @contents << o
53:       o
54:     when AnyName
55:       o = Any.new
56:       @contents << o
57:       o
58:     when ElementName
59:       o = Element.new
60:       @contents << o
61:       o
62:     else
63:       nil
64:     end
65:   end

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 78
78:   def parse_epilogue
79:     update_elements
80:   end

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 32
32:   def targetnamespace
33:     parent.targetnamespace
34:   end

Private Instance methods

[Source]

    # File lib/wsdl/xmlSchema/content.rb, line 84
84:   def update_elements
85:     @elements = []
86:     @contents.each do |content|
87:       if content.is_a?(Element)
88:         @elements << [content.name, content]
89:       end
90:     end
91:   end

[Validate]