Class: Roby::DRoby::V5::DRobyConstant
- Defined in:
- lib/roby/droby/v5/droby_constant.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
-
#name ⇒ Object
readonly
The constant name.
-
#remote_siblings ⇒ Object
readonly
Returns the value of attribute remote_siblings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, remote_siblings = Hash.new) ⇒ DRobyConstant
constructor
A new instance of DRobyConstant.
-
#proxy(peer) ⇒ Object
Returns the local object which can be referenced by this name, or raises ArgumentError.
- #to_s ⇒ Object
Constructor Details
#initialize(name, remote_siblings = Hash.new) ⇒ DRobyConstant
Returns a new instance of DRobyConstant.
69 70 71 72 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 69 def initialize(name, remote_siblings = Hash.new) @name = name @remote_siblings = remote_siblings end |
Instance Attribute Details
#name ⇒ Object (readonly)
The constant name
67 68 69 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 67 def name @name end |
#remote_siblings ⇒ Object (readonly)
Returns the value of attribute remote_siblings.
64 65 66 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 64 def remote_siblings @remote_siblings end |
Class Method Details
.clear_cache ⇒ Object
20 21 22 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 20 def self.clear_cache @@valid_constants.clear end |
.valid_constants ⇒ Object
25 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 25 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.
75 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 75 def proxy(peer); constant(name) end |
#to_s ⇒ Object
26 |
# File 'lib/roby/droby/v5/droby_constant.rb', line 26 def to_s; "#<dRoby:Constant #{name}>" end |