class Sumac::RemoteObjectChild

Public Class Methods

new(connection, parent, key) click to toggle source
# File lib/sumac/remote_object_child.rb, line 4
def initialize(connection, parent, key)
  raise "argument 'connection' must be a Connection" unless connection.is_a?(Connection)
  @connection = connection
  raise unless parent.is_a?(RemoteObject)
  @parent = parent
  @key = key
end

Public Instance Methods

__key__() click to toggle source
# File lib/sumac/remote_object_child.rb, line 25
def __key__
  @key
end
__parent__() click to toggle source
# File lib/sumac/remote_object_child.rb, line 29
def __parent__
  @parent
end
inspect() click to toggle source
# File lib/sumac/remote_object_child.rb, line 33
def inspect
  "#<Sumac::RemoteObjectChild:#{"0x00%x" % (object_id << 1)}>"
end
method_missing(method_name, *arguments, &block) click to toggle source
# File lib/sumac/remote_object_child.rb, line 12
def method_missing(method_name, *arguments, &block)  # blocks not working yet
  @connection.mutex.lock
  begin
    arguments << block.to_lambda if block_given?
    return_value = @connection.call_dispatcher.make_call(self, method_name.to_s, arguments)
  rescue ClosedError
    raise StaleObjectError
  end
  return_value
ensure
  @connection.mutex.unlock if @connection.mutex.owned?
end