Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

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
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus