Class: SOAP::SOAPReference

Class | SOAP::SOAPReference
In: | soap/baseData.rb
Parent: | XSD::NSDBase

Convenience datatypes.

### Methods

__getobj__ __setobj__ create_refid decode method_missing new refidstr

### Included Modules

SOAPBasetype

### Attributes

refid | [RW] |

### Public Class methods

create_refid(obj)

[Source]

    # File soap/baseData.rb, line 156
      def self.create_refid(obj)
        'id' + obj.__id__.to_s
      end

decode(elename, refidstr)

[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)

Override the definition in SOAPBasetype.

[Source]

    # 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__()

[Source]

    # File soap/baseData.rb, line 123
      def __getobj__
        @obj
      end

__setobj__(obj)

[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)

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…

[Source]

    # File soap/baseData.rb, line 144
      def method_missing(msg_id, *params)
        if @obj
          @obj.send(msg_id, *params)
        else
          nil
        end
      end

refidstr()

[Source]

    # File soap/baseData.rb, line 152
      def refidstr
        '#' + @refid
      end

[Validate]