Class: WSDL::XMLSchema::ComplexRestriction

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

#initializeComplexRestriction

Returns a new instance of ComplexRestriction.



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

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#baseObject

Returns the value of attribute base.



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

def base
  @base
end

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#check_typeObject



55
56
57
58
59
60
61
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 55

def check_type
  if @base == ::SOAP::ValueArrayName
    :TYPE_ARRAY
  else
    basetype.check_type if basetype
  end
end

#choice?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 43

def choice?
  @content and @content.choice?
end

#elementformdefaultObject



35
36
37
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 35

def elementformdefault
  parent.elementformdefault
end

#elementsObject



47
48
49
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 47

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

#have_any?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 39

def have_any?
  @content and @content.have_any?
end

#nested_elementsObject



51
52
53
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 51

def nested_elements
  @content ? @content.nested_elements : XSD::NamedElements::Empty
end

#parse_attr(attr, value) ⇒ Object



89
90
91
92
93
94
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 89

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

#parse_element(element) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 63

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



31
32
33
# File 'lib/wsdl/xmlSchema/complexRestriction.rb', line 31

def targetnamespace
  parent.targetnamespace
end