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.



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

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

Instance Attribute Details

#extensionObject

Returns the value of attribute extension.



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

def extension
  @extension
end

#mixedObject

Returns the value of attribute mixed.



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

def mixed
  @mixed
end

#restrictionObject

Returns the value of attribute restriction.



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

def restriction
  @restriction
end

Instance Method Details

#attributesObject



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

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

#baseObject



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

def base
  content ? content.base : nil
end

#check_typeObject



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

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

#choice?Boolean

Returns:

  • (Boolean)


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

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

#contentObject



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

def content
  @extension || @restriction
end

#elementformdefaultObject



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

def elementformdefault
  parent.elementformdefault
end

#elementsObject



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

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

#have_any?Boolean

Returns:

  • (Boolean)


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

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

#nested_elementsObject



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

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

#parse_attr(attr, value) ⇒ Object



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

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

#parse_element(element) ⇒ Object



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

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



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

def targetnamespace
  parent.targetnamespace
end