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



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

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.



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

def content=(value)
  @content = value
end

#maxoccursObject

Returns the value of attribute maxoccurs



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

def maxoccurs
  @maxoccurs
end

#minoccursObject

Returns the value of attribute minoccurs



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

def minoccurs
  @minoccurs
end

#name=(value) ⇒ Object (writeonly)

required



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

def name=(value)
  @name = value
end

Instance Method Details

#elementformdefaultObject



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

def elementformdefault
  parent.elementformdefault
end

#parse_attr(attr, value) ⇒ Object



59
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
# File 'lib/wsdl/xmlSchema/group.rb', line 59

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



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

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



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

def targetnamespace
  parent.targetnamespace
end