Class DRb::DRbUnknown
In: drb/drb.rb
Parent: Object

Class wrapping a marshalled object whose type is unknown locally.

If an object is returned by a method invoked over drb, but the class of the object is unknown in the client namespace, or the object is a constant unknown in the client namespace, then the still-marshalled object is returned wrapped in a DRbUnknown instance.

If this object is passed as an argument to a method invoked over drb, then the wrapped object is passed instead.

The class or constant name of the object can be read from the name attribute. The marshalled object is held in the buf attribute.

Methods

exception   new   reload  

Attributes

buf  [R]  Buffer contained the marshalled, unknown object.
name  [R]  The name of the unknown thing.

Class name for unknown objects; variable name for unknown constants.

Public Class methods

Create a new DRbUnknown object.

buf is a string containing a marshalled object that could not be unmarshalled. err is the error message that was raised when the unmarshalling failed. It is used to determine the name of the unmarshalled object.

[Source]

     # File drb/drb.rb, line 463
463:     def initialize(err, buf)
464:       case err.to_s
465:       when /uninitialized constant (\S+)/
466:         @name = $1
467:       when /undefined class\/module (\S+)/
468:         @name = $1
469:       else
470:         @name = nil
471:       end
472:       @buf = buf
473:     end

Public Instance methods

Create a DRbUnknownError exception containing this object.

[Source]

     # File drb/drb.rb, line 506
506:     def exception
507:       DRbUnknownError.new(self)
508:     end

Attempt to load the wrapped marshalled object again.

If the class of the object is now known locally, the object will be unmarshalled and returned. Otherwise, a new but identical DRbUnknown object will be returned.

[Source]

     # File drb/drb.rb, line 501
501:     def reload
502:       self.class._load(@buf)
503:     end

Search

Google

Ruby API Docs

Links