Class: Roby::Distributed::DRobyConstant

Inherits:
Object
  • Object
show all
Defined in:
lib/roby/distributed/protocol.rb

Overview

Dumps a constant by using its name. On reload, #proxy searches for a constant with the same name, and raises ArgumentError if none exists.

Defined Under Namespace

Modules: Dump

Constant Summary collapse

@@valid_constants =
Hash.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ DRobyConstant

Returns a new instance of DRobyConstant.



320
# File 'lib/roby/distributed/protocol.rb', line 320

def initialize(name); @name = name end

Instance Attribute Details

#nameObject (readonly)

The constant name



319
320
321
# File 'lib/roby/distributed/protocol.rb', line 319

def name
  @name
end

Class Method Details

.valid_constantsObject



295
# File 'lib/roby/distributed/protocol.rb', line 295

def self.valid_constants; @@valid_constants end

Instance Method Details

#proxy(peer) ⇒ Object

Returns the local object which can be referenced by this name, or raises ArgumentError.



323
# File 'lib/roby/distributed/protocol.rb', line 323

def proxy(peer); constant(name) end

#to_sObject



296
# File 'lib/roby/distributed/protocol.rb', line 296

def to_s; "#<dRoby:Constant #{name}>" end