Parent

Included Modules

Files

Class Index [+]

Quicksearch

SOAP::SOAPReference

Convenience datatypes.

Attributes

refid[RW]

Public Class Methods

create_refid(obj) click to toggle source
     # File lib/soap/baseData.rb, line 180
180:   def self.create_refid(obj)
181:     'id' + obj.__id__.to_s
182:   end
decode(elename, refidstr) click to toggle source
     # File lib/soap/baseData.rb, line 184
184:   def self.decode(elename, refidstr)
185:     if /\A#(.*)\z/ =~ refidstr
186:       refid = $1
187:     elsif /\Acid:(.*)\z/ =~ refidstr
188:       refid = $1
189:     else
190:       raise ArgumentError.new("illegal refid #{refidstr}")
191:     end
192:     d = super(elename)
193:     d.refid = refid
194:     d
195:   end
new(obj = nil) click to toggle source

Override the definition in SOAPBasetype.

     # File lib/soap/baseData.rb, line 131
131:   def initialize(obj = nil)
132:     super()
133:     @type = XSD::QName::EMPTY
134:     @refid = nil
135:     @obj = nil
136:     __setobj__(obj) if obj
137:   end

Public Instance Methods

__getobj__() click to toggle source
     # File lib/soap/baseData.rb, line 139
139:   def __getobj__
140:     @obj
141:   end
__setobj__(obj) click to toggle source
     # File lib/soap/baseData.rb, line 143
143:   def __setobj__(obj)
144:     @obj = obj
145:     @refid = @obj.id || SOAPReference.create_refid(@obj)
146:     @obj.id = @refid unless @obj.id
147:     @obj.precedents << self
148:     # Copies NSDBase information
149:     @obj.type = @type unless @obj.type
150:   end
data() click to toggle source

for referenced base type such as a long value from Axis. base2obj requires a node to respond to :data

     # File lib/soap/baseData.rb, line 170
170:   def data
171:     if @obj.respond_to?(:data)
172:       @obj.data
173:     end
174:   end
method_missing(msg_id, *params) click to toggle source

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...

     # File lib/soap/baseData.rb, line 160
160:   def method_missing(msg_id, *params)
161:     if @obj
162:       @obj.send(msg_id, *params)
163:     else
164:       nil
165:     end
166:   end
refidstr() click to toggle source
     # File lib/soap/baseData.rb, line 176
176:   def refidstr
177:     '#' + @refid
178:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.