Class: DRb::DRbArray (Ruby 2.7.5)
Description: Class : DRb::DRbArray - Ruby 2.7.5

### Home Classes Methods

### In Files

- drb/drb.rb

### Parent

Object

### Methods

- ::new

### 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::ThreadObject
- DRb::TimerIdConv
- DRb::TimerIdConv::TimerHolder2
- DRb::TimerIdConv::TimerHolder2::InvalidIndexError
- DRb::WeakIdConv
- DRb::WeakIdConv::WeakSet
- Object

No matching classes.

# DRb::DRbArray

An Array wrapper that can be sent to another server via `DRb`.

All entries in the array will be dumped or be references that point to the local server.

### Public Class Methods

new(ary) click to toggle source

Creates a new `DRbArray` that either dumps or wraps all the items in the Array `ary` so they can be loaded by a remote `DRb` server.

                   # File drb/drb.rb, line 522
    def initialize(ary)
      @ary = ary.collect { |obj|
        if obj.kind_of? DRbUndumped
          DRbObject.new(obj)
        else
          begin
            Marshal.dump(obj)
            obj
          rescue
            DRbObject.new(obj)
          end
        end
      }
    end