Class: DRb::DRbUnknown (Ruby 2.4.2)
Description: Class : DRb::DRbUnknown - Ruby 2.4.2

Support for the Ruby 2.4 series has ended. See here for reference.

### Home Classes Methods

### In Files

- drb/drb.rb

### Parent

Object

### Methods

- ::new
- #exception
- #reload

### Class/Module Index

Quicksearch

- ACL
- ACL::ACLEntry
- ACL::ACLList
- DRb
- DRb::DRbArray
- DRb::DRbBadScheme
- DRb::DRbBadURI
- DRb::DRbConn
- DRb::DRbConnError
- DRb::DRbError
- DRb::DRbIdConv
- DRb::DRbIdConv
- DRb::DRbMessage
- DRb::DRbObject
- DRb::DRbObject
- DRb::DRbObservable
- DRb::DRbProtocol
- DRb::DRbRemoteError
- DRb::DRbSSLSocket
- DRb::DRbSSLSocket::SSLConfig
- DRb::DRbServerNotFound
- DRb::DRbTCPSocket
- DRb::DRbUNIXSocket
- DRb::DRbUndumped
- DRb::DRbUndumped
- DRb::DRbUnknown
- DRb::DRbUnknownError
- DRb::ExtServ
- DRb::ExtServManager
- DRb::GW
- DRb::GWIdConv
- DRb::TimerIdConv
- DRb::TimerIdConv::TimerHolder2
- DRb::TimerIdConv::TimerHolder2::InvalidIndexError
- Object

No matching classes.

# DRb::DRbUnknown

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.

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

new(err, buf) click to toggle source

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.

                   # File drb/drb.rb, line 466
    def initialize(err, buf)
      case err.to_s
      when /uninitialized constant (\S+)/
        @name = $1
      when /undefined class\/module (\S+)/
        @name = $1
      else
        @name = nil
      end
      @buf = buf
    end

### Public Instance Methods

exception() click to toggle source

Create a `DRbUnknownError` exception containing this object.

                   # File drb/drb.rb, line 509
    def exception
      DRbUnknownError.new(self)
    end

reload() click to toggle source

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.

                   # File drb/drb.rb, line 504
    def reload
      self.class._load(@buf)
    end