class Dizby::DistributedObject

Public Class Methods

_load(str) click to toggle source
# File lib/dizby/distributed/object.rb, line 12
def self._load(str)
  SemiObjectProxy.new(*Marshal.load(str))
end
new(obj, server) click to toggle source
# File lib/dizby/distributed/object.rb, line 20
def initialize(obj, server)
  @obj = obj
  @server = server
end

Public Instance Methods

_dump(_) click to toggle source
# File lib/dizby/distributed/object.rb, line 16
def _dump(_)
  Marshal.dump [@server.uri, @server.to_id(@obj)]
end
method_missing(msg_id, *args, &block) click to toggle source

rubocop:disable Style/MethodMissing

# File lib/dizby/distributed/object.rb, line 26
def method_missing(msg_id, *args, &block)
  @server.log.debug("calling: #{msg_id} #{args.join ', '}")
  Dizby.check_insecure_method(@obj, msg_id)
  @obj.__send__(msg_id, *args, &block)
end
respond_to?(msg_id, priv = false) click to toggle source

rubocop:enable Style/MethodMissing

# File lib/dizby/distributed/object.rb, line 33
def respond_to?(msg_id, priv = false)
  responds =
    case msg_id
    when :_dump
      true
    when :marshal_dump
      false
    else
      method_missing(:respond_to?, msg_id, priv)
    end

  @server.log.debug("respond_to?(#{msg_id}) => #{responds}")
  responds
end
Also aliased as: respond_to_missing?
respond_to_missing?(msg_id, priv = false)

rubocop:disable Style/Alias

Alias for: respond_to?