Class: WSDL::XMLSchema::AttributeGroup

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

#initializeAttributeGroup

Returns a new instance of AttributeGroup.



46
47
48
49
50
51
52
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 46

def initialize
  super
  @name = nil
  @attributes = nil
  @ref = nil
  @refelement = nil
end

Instance Attribute Details

#attributes=(value) ⇒ Object (writeonly)

Sets the attribute attributes

Parameters:

  • value

    the value to set the attribute attributes to.



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

def attributes=(value)
  @attributes = value
end

#name=(value) ⇒ Object (writeonly)

required



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

def name=(value)
  @name = value
end

#refObject

Returns the value of attribute ref.



44
45
46
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 44

def ref
  @ref
end

Instance Method Details

#attr_reader_ref(symbol) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 19

def attr_reader_ref(symbol)
  name = symbol.to_s
  define_method(name) {
    instance_variable_get("@#{name}") ||
      (refelement ? refelement.__send__(name) : nil)
  }
end

#parse_attr(attr, value) ⇒ Object



72
73
74
75
76
77
78
79
80
81
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 72

def parse_attr(attr, value)
  case attr
  when NameAttrName
    @name = XSD::QName.new(targetnamespace, value.source)
  when RefAttrName
    @ref = value
  else
    nil
  end
end

#parse_element(element) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 62

def parse_element(element)
  case element
  when AttributeName
    @attributes ||= XSD::NamedElements.new
    o = Attribute.new
    @attributes << o
    o
  end
end

#refelementObject



54
55
56
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 54

def refelement
  @refelement ||= root.collect_attributegroups[@ref]
end

#targetnamespaceObject



58
59
60
# File 'lib/wsdl/xmlSchema/attributeGroup.rb', line 58

def targetnamespace
  parent.targetnamespace
end