Class: WSDL::XMLSchema::Group

Inherits:
Info show all
Includes:
Ref
Defined in:
lib/wsdl/xmlSchema/group.rb

Instance Attribute Summary collapse

Attributes included from Ref

#ref

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods included from Ref

included

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initialize(name = nil) ⇒ Group

Returns a new instance of Group.



29
30
31
32
33
34
35
36
37
# File 'lib/wsdl/xmlSchema/group.rb', line 29

def initialize(name = nil)
  super()
  @name = name
  @maxoccurs = 1
  @minoccurs = 1
  @content = nil
  @ref = nil
  @refelement = nil
end

Instance Attribute Details

#content=(value) ⇒ Object (writeonly)

Sets the attribute content

Parameters:

  • value

    the value to set the attribute content to.



24
25
26
# File 'lib/wsdl/xmlSchema/group.rb', line 24

def content=(value)
  @content = value
end

#maxoccursObject

Returns the value of attribute maxoccurs.



22
23
24
# File 'lib/wsdl/xmlSchema/group.rb', line 22

def maxoccurs
  @maxoccurs
end

#minoccursObject

Returns the value of attribute minoccurs.



23
24
25
# File 'lib/wsdl/xmlSchema/group.rb', line 23

def minoccurs
  @minoccurs
end

#name=(value) ⇒ Object (writeonly)

required



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

def name=(value)
  @name = value
end

Instance Method Details

#elementformdefaultObject



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

def elementformdefault
  parent.elementformdefault
end

#parse_attr(attr, value) ⇒ Object



60
61
62
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
88
89
90
# File 'lib/wsdl/xmlSchema/group.rb', line 60

def parse_attr(attr, value)
  case attr
  when NameAttrName
    @name = XSD::QName.new(targetnamespace, value.source)
  when RefAttrName
    @ref = value
  when MaxOccursAttrName
    if parent.is_a?(All)
	if value.source != '1'
 raise Parser::AttributeConstraintError.new(
          "cannot parse #{value} for #{attr}")
	end
    end
    if value.source == 'unbounded'
      @maxoccurs = nil
    else
      @maxoccurs = Integer(value.source)
    end
    value.source
  when MinOccursAttrName
    if parent.is_a?(All)
	unless ['0', '1'].include?(value.source)
 raise Parser::AttributeConstraintError.new(
          "cannot parse #{value} for #{attr}")
	end
    end
    @minoccurs = Integer(value.source)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/wsdl/xmlSchema/group.rb', line 47

def parse_element(element)
  case element
  when AllName
    @content = All.new
  when SequenceName
    @content = Sequence.new
  when ChoiceName
    @content = Choice.new
  else
    nil
  end
end

#targetnamespaceObject



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

def targetnamespace
  parent.targetnamespace
end