Class: WSDL::XMLSchema::Sequence

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

#initializeSequence

Returns a new instance of Sequence.



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

def initialize
  super()
  @minoccurs = '1'
  @maxoccurs = '1'
  @elements = []
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements



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

def elements
  @elements
end

#maxoccursObject (readonly)

Returns the value of attribute maxoccurs



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

def maxoccurs
  @maxoccurs
end

#minoccursObject (readonly)

Returns the value of attribute minoccurs



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

def minoccurs
  @minoccurs
end

Instance Method Details

#<<(element) ⇒ Object



36
37
38
# File 'lib/wsdl/xmlSchema/sequence.rb', line 36

def <<(element)
  @elements << element
end

#elementformdefaultObject



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

def elementformdefault
  parent.elementformdefault
end

#parse_attr(attr, value) ⇒ Object



55
56
57
58
59
60
61
62
63
64
# File 'lib/wsdl/xmlSchema/sequence.rb', line 55

def parse_attr(attr, value)
  case attr
  when MaxOccursAttrName
    @maxoccurs = value.source
  when MinOccursAttrName
    @minoccurs = value.source
  else
    nil
  end
end

#parse_element(element) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/wsdl/xmlSchema/sequence.rb', line 40

def parse_element(element)
  case element
  when AnyName
    o = Any.new
    @elements << o
    o
  when ElementName
    o = Element.new
    @elements << o
    o
  else
    nil
  end
end

#targetnamespaceObject



28
29
30
# File 'lib/wsdl/xmlSchema/sequence.rb', line 28

def targetnamespace
  parent.targetnamespace
end