Class: DRb::DRbUnknown

Inherits:
Object
  • Object
show all
Defined in:
lib/drb/drb.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(err, buf) ⇒ DRbUnknown

Returns a new instance of DRbUnknown.



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/drb/drb.rb', line 35

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

Instance Attribute Details

#bufObject (readonly)

Returns the value of attribute buf.



48
49
50
# File 'lib/drb/drb.rb', line 48

def buf
  @buf
end

#nameObject (readonly)

Returns the value of attribute name.



47
48
49
# File 'lib/drb/drb.rb', line 47

def name
  @name
end

Class Method Details

._load(s) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/drb/drb.rb', line 50

def self._load(s)
  begin
    Marshal::load(s)
  rescue NameError, ArgumentError
    DRbUnknown.new($!, s)
  end
end

Instance Method Details

#_dump(lv) ⇒ Object



58
59
60
# File 'lib/drb/drb.rb', line 58

def _dump(lv)
  @buf
end

#exceptionObject



66
67
68
# File 'lib/drb/drb.rb', line 66

def exception
  DRbUnknownError.new(self)
end

#reloadObject



62
63
64
# File 'lib/drb/drb.rb', line 62

def reload
  self.class._load(@buf)
end