Class: DRb::DRbUnknown

Inherits:
Object
  • Object
show all
Defined in:
lib/opal/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.



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/opal/drb/drb.rb', line 38

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.



51
52
53
# File 'lib/opal/drb/drb.rb', line 51

def buf
  @buf
end

#nameObject (readonly)

Returns the value of attribute name.



50
51
52
# File 'lib/opal/drb/drb.rb', line 50

def name
  @name
end

Class Method Details

._load(s) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/opal/drb/drb.rb', line 53

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

Instance Method Details

#_dump(lv) ⇒ Object



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

def _dump(lv)
  @buf
end

#exceptionObject



69
70
71
# File 'lib/opal/drb/drb.rb', line 69

def exception
  DRbUnknownError.new(self)
end

#reloadObject



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

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