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.



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

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.



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

def arytype
  @arytype
end

#default=(value) ⇒ Object (writeonly)

Sets the attribute default

Parameters:

  • value

    the value to set the attribute default to.



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

def default=(value)
  @default = value
end

#fixed=(value) ⇒ Object (writeonly)

Sets the attribute fixed

Parameters:

  • value

    the value to set the attribute fixed to.



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

def fixed=(value)
  @fixed = value
end

#form=(value) ⇒ Object (writeonly)

Sets the attribute form

Parameters:

  • value

    the value to set the attribute form to.



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

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.



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

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.



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

def name=(value)
  @name = value
end

#type=(value) ⇒ Object (writeonly)

Sets the attribute type

Parameters:

  • value

    the value to set the attribute type to.



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

def type=(value)
  @type = value
end

#use=(value) ⇒ Object (writeonly)

Sets the attribute use

Parameters:

  • value

    the value to set the attribute use to.



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

def use=(value)
  @use = value
end

Instance Method Details

#parse_attr(attr, value) ⇒ Object



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

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



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

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

#targetnamespaceObject



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

def targetnamespace
  parent.targetnamespace
end