Class: WSDL::XMLSchema::Attribute

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

#initializeAttribute

Returns a new instance of Attribute.



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

def initialize
  super
  @use = nil
  @form = nil
  @name = nil
  @type = nil
  @local_simpletype = nil
  @default = nil
  @fixed = nil
  @ref = nil
  @refelement = nil
  @arytype = nil
end

Instance Attribute Details

#arytypeObject

Returns the value of attribute arytype.



37
38
39
# File 'lib/wsdl/xmlSchema/attribute.rb', line 37

def arytype
  @arytype
end

#default=(value) ⇒ Object (writeonly)

Sets the attribute default

Parameters:

  • value

    the value to set the attribute default to.



26
27
28
# File 'lib/wsdl/xmlSchema/attribute.rb', line 26

def default=(value)
  @default = value
end

#fixed=(value) ⇒ Object (writeonly)

Sets the attribute fixed

Parameters:

  • value

    the value to set the attribute fixed to.



27
28
29
# File 'lib/wsdl/xmlSchema/attribute.rb', line 27

def fixed=(value)
  @fixed = value
end

#form=(value) ⇒ Object (writeonly)

Sets the attribute form

Parameters:

  • value

    the value to set the attribute form to.



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

def form=(value)
  @form = value
end

#local_simpletype=(value) ⇒ Object (writeonly)

Sets the attribute local_simpletype

Parameters:

  • value

    the value to set the attribute local_simpletype to.



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

def local_simpletype=(value)
  @local_simpletype = value
end

#name=(value) ⇒ Object (writeonly)

Sets the attribute name

Parameters:

  • value

    the value to set the attribute name to.



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

def name=(value)
  @name = value
end

#type=(value) ⇒ Object (writeonly)

Sets the attribute type

Parameters:

  • value

    the value to set the attribute type to.



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

def type=(value)
  @type = value
end

#use=(value) ⇒ Object (writeonly)

Sets the attribute use

Parameters:

  • value

    the value to set the attribute use to.



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

def use=(value)
  @use = value
end

Instance Method Details

#parse_attr(attr, value) ⇒ Object



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/attribute.rb', line 65

def parse_attr(attr, value)
  case attr
  when RefAttrName
    @ref = value
  when UseAttrName
    @use = value.source
  when FormAttrName
    @form = value.source
  when NameAttrName
    if directelement?
      @name = XSD::QName.new(targetnamespace, value.source)
    else
      @name = XSD::QName.new(nil, value.source)
    end
  when TypeAttrName
    @type = value
  when DefaultAttrName
    @default = value.source
  when FixedAttrName
    @fixed = value.source
  when ArrayTypeAttrName
    @arytype = value
  else
    nil
  end
end

#parse_element(element) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/wsdl/xmlSchema/attribute.rb', line 57

def parse_element(element)
  case element
  when SimpleTypeName
    @local_simpletype = SimpleType.new
    @local_simpletype
  end
end

#targetnamespaceObject



53
54
55
# File 'lib/wsdl/xmlSchema/attribute.rb', line 53

def targetnamespace
  parent.targetnamespace
end