Class: SOAP::SOAPReference
- Inherits:
-
XSD::NSDBase
- Object
- XSD::NSDBase
- SOAP::SOAPReference
- Extended by:
- SOAPModuleUtils
- Includes:
- SOAPBasetype
- Defined in:
- lib/soap/baseData.rb
Overview
Convenience datatypes.
Constant Summary
Constants included from SOAP
AttrActor, AttrActorName, AttrArrayType, AttrArrayTypeName, AttrEncodingStyle, AttrEncodingStyleName, AttrHref, AttrHrefName, AttrId, AttrIdName, AttrMustUnderstand, AttrMustUnderstandName, AttrOffset, AttrOffsetName, AttrPosition, AttrPositionName, AttrRoot, AttrRootName, Base64Literal, EleBody, EleBodyName, EleEnvelope, EleEnvelopeName, EleFault, EleFaultActor, EleFaultActorName, EleFaultCode, EleFaultCodeName, EleFaultDetail, EleFaultDetailName, EleFaultName, EleFaultString, EleFaultStringName, EleHeader, EleHeaderName, EncodingNamespace, EnvelopeNamespace, LiteralNamespace, MediaType, NextActor, PropertyName, SOAPProxy, TypeMap, VERSION, ValueArray, ValueArrayName
Instance Attribute Summary collapse
-
#refid ⇒ Object
Returns the value of attribute refid.
Attributes included from SOAPBasetype
Attributes included from SOAPType
#definedtype, #elename, #encodingstyle, #extraattr, #force_typed, #id, #parent, #position, #precedents, #root
Attributes inherited from XSD::NSDBase
Class Method Summary collapse
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #__setobj__(obj) ⇒ Object
-
#data ⇒ Object
for referenced base type such as a long value from Axis.
-
#initialize(obj = nil) ⇒ SOAPReference
constructor
Override the definition in SOAPBasetype.
-
#method_missing(msg_id, *params) ⇒ Object
Why don’t I use delegate.rb? -> delegate requires target object type at initialize time.
- #refidstr ⇒ Object
Methods included from SOAPModuleUtils
Methods included from SOAPType
Methods inherited from XSD::NSDBase
Constructor Details
#initialize(obj = nil) ⇒ SOAPReference
Override the definition in SOAPBasetype.
133 134 135 136 137 138 139 |
# File 'lib/soap/baseData.rb', line 133 def initialize(obj = nil) super() @type = XSD::QName::EMPTY @refid = nil @obj = nil __setobj__(obj) if obj end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(msg_id, *params) ⇒ Object
Why don’t I use delegate.rb? -> delegate requires target object type at initialize time. Why don’t I use forwardable.rb? -> forwardable requires a list of forwarding methods.
ToDo: Maybe I should use forwardable.rb and give it a methods list like delegate.rb…
162 163 164 165 166 167 168 |
# File 'lib/soap/baseData.rb', line 162 def method_missing(msg_id, *params) if @obj @obj.send(msg_id, *params) else nil end end |
Instance Attribute Details
#refid ⇒ Object
Returns the value of attribute refid.
130 131 132 |
# File 'lib/soap/baseData.rb', line 130 def refid @refid end |
Class Method Details
.create_refid(obj) ⇒ Object
182 183 184 |
# File 'lib/soap/baseData.rb', line 182 def self.create_refid(obj) 'id' + obj.__id__.to_s end |
.decode(elename, refidstr) ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/soap/baseData.rb', line 186 def self.decode(elename, refidstr) if /\A#(.*)\z/ =~ refidstr refid = $1 elsif /\Acid:(.*)\z/ =~ refidstr refid = $1 else raise ArgumentError.new("illegal refid #{refidstr}") end d = super(elename) d.refid = refid d end |
Instance Method Details
#__getobj__ ⇒ Object
141 142 143 |
# File 'lib/soap/baseData.rb', line 141 def __getobj__ @obj end |
#__setobj__(obj) ⇒ Object
145 146 147 148 149 150 151 152 |
# File 'lib/soap/baseData.rb', line 145 def __setobj__(obj) @obj = obj @refid = @obj.id || SOAPReference.create_refid(@obj) @obj.id = @refid unless @obj.id @obj.precedents << self # Copies NSDBase information @obj.type = @type unless @obj.type end |
#data ⇒ Object
for referenced base type such as a long value from Axis. base2obj requires a node to respond to :data
172 173 174 175 176 |
# File 'lib/soap/baseData.rb', line 172 def data if @obj.respond_to?(:data) @obj.data end end |
#refidstr ⇒ Object
178 179 180 |
# File 'lib/soap/baseData.rb', line 178 def refidstr '#' + @refid end |