In Files

  • soap/baseData.rb

Class/Module Index [+]

Quicksearch

SOAP::SOAPReference

Convenience datatypes.

Attributes

refid[RW]

Public Class Methods

create_refid(obj) click to toggle source
 
               # File soap/baseData.rb, line 156
def self.create_refid(obj)
  'id' + obj.__id__.to_s
end
            
decode(elename, refidstr) click to toggle source
 
               # File soap/baseData.rb, line 160
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
            
new(obj = nil) click to toggle source

Override the definition in SOAPBasetype.

 
               # File soap/baseData.rb, line 115
def initialize(obj = nil)
  super()
  @type = XSD::QName::EMPTY
  @refid = nil
  @obj = nil
  __setobj__(obj) if obj
end
            

Public Instance Methods

__getobj__() click to toggle source
 
               # File soap/baseData.rb, line 123
def __getobj__
  @obj
end
            
__setobj__(obj) click to toggle source
 
               # File soap/baseData.rb, line 127
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
            
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 soap/baseData.rb, line 144
def method_missing(msg_id, *params)
  if @obj
    @obj.send(msg_id, *params)
  else
    nil
  end
end
            
refidstr() click to toggle source
 
               # File soap/baseData.rb, line 152
def refidstr
  '#' + @refid
end