Class: WSDL::XMLSchema::ComplexContent

Inherits:
Info show all
Defined in:
lib/wsdl/xmlSchema/complexContent.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

#initializeComplexContent

Returns a new instance of ComplexContent.



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

def initialize
  super
  @restriction = nil
  @extension = nil
  @mixed = false
end

Instance Attribute Details

#extensionObject

Returns the value of attribute extension.



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

def extension
  @extension
end

#mixedObject

Returns the value of attribute mixed.



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

def mixed
  @mixed
end

#restrictionObject

Returns the value of attribute restriction.



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

def restriction
  @restriction
end

Instance Method Details

#attributesObject



57
58
59
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 57

def attributes
  content ? content.attributes : XSD::NamedElements::Empty
end

#baseObject



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

def base
  content ? content.base : nil
end

#check_typeObject



66
67
68
69
70
71
72
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 66

def check_type
  if content
    content.check_type
  else
    raise ArgumentError.new("incomplete complexContent")
  end
end

#choice?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 49

def choice?
  content ? content.choice? : nil
end

#contentObject



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

def content
  @extension || @restriction
end

#elementformdefaultObject



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

def elementformdefault
  parent.elementformdefault
end

#elementsObject



53
54
55
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 53

def elements
  content ? content.elements : XSD::NamedElements::Empty
end

#have_any?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 45

def have_any?
  content ? content.have_any? : nil
end

#nested_elementsObject



61
62
63
64
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 61

def nested_elements
  # restrict and extension does not have particle.
  content ? content.nested_elements : XSD::NamedElements::Empty
end

#parse_attr(attr, value) ⇒ Object



85
86
87
88
89
90
91
92
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 85

def parse_attr(attr, value)
  case attr
  when MixedAttrName
    @mixed = to_boolean(value)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



74
75
76
77
78
79
80
81
82
83
# File 'lib/wsdl/xmlSchema/complexContent.rb', line 74

def parse_element(element)
  case element
  when RestrictionName
    raise ArgumentError.new("incomplete complexContent") if content
    @restriction = ComplexRestriction.new
  when ExtensionName
    raise ArgumentError.new("incomplete complexContent") if content
    @extension = ComplexExtension.new
  end
end

#targetnamespaceObject



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

def targetnamespace
  parent.targetnamespace
end