Class: WSDL::XMLSchema::ComplexExtension

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

Instance Attribute Summary collapse

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initializeComplexExtension

Returns a new instance of ComplexExtension.



21
22
23
24
25
26
27
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 21

def initialize
  super
  @base = nil
  @basetype = nil
  @content = nil
  @attributes = XSD::NamedElements.new
end

Instance Attribute Details

#baseObject

Returns the value of attribute base.



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

def base
  @base
end

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#attributesObject



59
60
61
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 59

def attributes
  basetype.attributes + @attributes
end

#check_typeObject



63
64
65
66
67
68
69
70
71
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 63

def check_type
  if @base == ::SOAP::ValueArrayName
    :TYPE_ARRAY
  elsif content or !@attributes.empty?
    :TYPE_STRUCT
  else
    basetype.check_type
  end
end

#choice?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 41

def choice?
  content and content.choice?
end

#elementformdefaultObject



33
34
35
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 33

def elementformdefault
  parent.elementformdefault
end

#elementsObject



45
46
47
48
49
50
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 45

def elements
  result = XSD::NamedElements.new
  result.concat(basetype.elements)
  result.concat(content.elements) if content
  result
end

#have_any?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 37

def have_any?
  basetype.have_any? or (content && content.have_any?)
end

#nested_elementsObject



52
53
54
55
56
57
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 52

def nested_elements
  result = XSD::NamedElements.new
  result.concat(basetype.nested_elements)
  result.concat(content.nested_elements) if content
  result
end

#parse_attr(attr, value) ⇒ Object



99
100
101
102
103
104
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 99

def parse_attr(attr, value)
  case attr
  when BaseAttrName
    @base = value
  end
end

#parse_element(element) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 73

def parse_element(element)
  case element
  when AllName
    @content = All.new
    @content
  when SequenceName
    @content = Sequence.new
    @content
  when ChoiceName
    @content = Choice.new
    @content
  when AttributeName
    o = Attribute.new
    @attributes << o
    o
  when AttributeGroupName
    o = AttributeGroup.new
    @attributes << o
    o
  when AnyAttributeName
    o = AnyAttribute.new
    @attributes << o
    o
  end
end

#targetnamespaceObject



29
30
31
# File 'lib/wsdl/xmlSchema/complexExtension.rb', line 29

def targetnamespace
  parent.targetnamespace
end