Class: WSDL::XMLSchema::Choice

Inherits:
Content show all
Defined in:
lib/wsdl/xmlSchema/choice.rb

Instance Attribute Summary collapse

Attributes inherited from Content

#elements, #maxoccurs, #minoccurs

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Content

#<<, #elementformdefault, #map_as_array?, #nested_elements, #parse_attr, #targetnamespace

Methods inherited from Info

#inspect, #parse_attr, #parse_epilogue

Constructor Details

#initializeChoice

Returns a new instance of Choice.



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

def initialize
  super()
  @any = nil
end

Instance Attribute Details

#anyObject (readonly)

Returns the value of attribute any.



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

def any
  @any
end

Instance Method Details

#choice?Boolean

Returns:

  • (Boolean)


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

def choice?
  true
end

#have_any?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/wsdl/xmlSchema/choice.rb', line 25

def have_any?
  !!@any
end

#parse_element(element) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/wsdl/xmlSchema/choice.rb', line 33

def parse_element(element)
  case element
  when SequenceName
    o = Sequence.new
    @elements << o
    o
  when ChoiceName
    o = Choice.new
    @elements << o
    o
  when GroupName
    o = Group.new
    @elements << o
    o
  when AnyName
    @any = Any.new
    @elements << @any
    @any
  else
    super(element)
  end
end