Class: WSDL::XMLSchema::Attribute
- Defined in:
- lib/wsdl/xmlSchema/attribute.rb
Instance Attribute Summary collapse
-
#arytype ⇒ Object
Returns the value of attribute arytype.
-
#default ⇒ Object
writeonly
Sets the attribute default.
-
#fixed ⇒ Object
writeonly
Sets the attribute fixed.
-
#form ⇒ Object
writeonly
Sets the attribute form.
-
#local_simpletype ⇒ Object
writeonly
Sets the attribute local_simpletype.
-
#name ⇒ Object
writeonly
Sets the attribute name.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#type ⇒ Object
writeonly
Sets the attribute type.
-
#use ⇒ Object
writeonly
Sets the attribute use.
Attributes inherited from Info
Instance Method Summary collapse
- #attr_reader_ref(symbol) ⇒ Object
-
#initialize ⇒ Attribute
constructor
A new instance of Attribute.
- #parse_attr(attr, value) ⇒ Object
- #parse_element(element) ⇒ Object
- #refelement ⇒ Object
- #targetnamespace ⇒ Object
Methods inherited from Info
Constructor Details
#initialize ⇒ Attribute
Returns a new instance of Attribute.
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 57 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
#arytype ⇒ Object
Returns the value of attribute arytype.
55 56 57 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 55 def arytype @arytype end |
#default=(value) ⇒ Object (writeonly)
Sets the attribute default
43 44 45 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 43 def default=(value) @default = value end |
#fixed=(value) ⇒ Object (writeonly)
Sets the attribute fixed
44 45 46 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 44 def fixed=(value) @fixed = value end |
#form=(value) ⇒ Object (writeonly)
Sets the attribute form
39 40 41 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 39 def form=(value) @form = value end |
#local_simpletype=(value) ⇒ Object (writeonly)
Sets the attribute local_simpletype
42 43 44 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 42 def local_simpletype=(value) @local_simpletype = value end |
#name=(value) ⇒ Object (writeonly)
Sets the attribute name
40 41 42 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 40 def name=(value) @name = value end |
#ref ⇒ Object
Returns the value of attribute ref.
54 55 56 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 54 def ref @ref end |
#type=(value) ⇒ Object (writeonly)
Sets the attribute type
41 42 43 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 41 def type=(value) @type = value end |
#use=(value) ⇒ Object (writeonly)
Sets the attribute use
38 39 40 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 38 def use=(value) @use = value end |
Instance Method Details
#attr_reader_ref(symbol) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/wsdl/xmlSchema/attribute.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
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 87 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
79 80 81 82 83 84 85 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 79 def parse_element(element) case element when SimpleTypeName @local_simpletype = SimpleType.new @local_simpletype end end |
#refelement ⇒ Object
71 72 73 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 71 def refelement @refelement ||= root.collect_attributes[@ref] end |
#targetnamespace ⇒ Object
75 76 77 |
# File 'lib/wsdl/xmlSchema/attribute.rb', line 75 def targetnamespace parent.targetnamespace end |