Class: WSDL::XMLSchema::Content

Inherits:
Info show all
Defined in:
lib/action_web_service/wsdl/xmlSchema/content.rb

Instance Attribute Summary collapse

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Info

#inspect

Constructor Details

#initializeContent

Returns a new instance of Content.



23
24
25
26
27
28
29
30
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 23

def initialize
  super()
  @final = nil
  @mixed = false
  @type = nil
  @contents = []
  @elements = []
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



20
21
22
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 20

def contents
  @contents
end

#elementsObject (readonly)

Returns the value of attribute elements.



21
22
23
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 21

def elements
  @elements
end

#finalObject

Returns the value of attribute final.



17
18
19
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 17

def final
  @final
end

#mixedObject

Returns the value of attribute mixed.



18
19
20
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 18

def mixed
  @mixed
end

#typeObject

Returns the value of attribute type.



19
20
21
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 19

def type
  @type
end

Instance Method Details

#<<(content) ⇒ Object



36
37
38
39
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 36

def <<(content)
  @contents << content
  update_elements
end

#eachObject



41
42
43
44
45
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 41

def each
  @contents.each do |content|
    yield content
  end
end

#parse_attr(attr, value) ⇒ Object



67
68
69
70
71
72
73
74
75
76
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 67

def parse_attr(attr, value)
  case attr
  when FinalAttrName
    @final = value.source
  when MixedAttrName
    @mixed = (value.source == 'true')
  else
    nil
  end
end

#parse_element(element) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 47

def parse_element(element)
  case element
  when AllName, SequenceName, ChoiceName
    o = Content.new
    o.type = element.name
    @contents << o
    o
  when AnyName
    o = Any.new
    @contents << o
    o
  when ElementName
    o = Element.new
    @contents << o
    o
  else
    nil
  end
end

#parse_epilogueObject



78
79
80
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 78

def parse_epilogue
  update_elements
end

#targetnamespaceObject



32
33
34
# File 'lib/action_web_service/wsdl/xmlSchema/content.rb', line 32

def targetnamespace
  parent.targetnamespace
end