Class: Roby::OpenStructModel::Variable
- Defined in:
- lib/roby/state/open_struct_model.rb
Overview
Base implementation for “leaf” values in an extended struct model
Direct Known Subclasses
Instance Attribute Summary collapse
-
#field ⇒ Object
The parent field.
-
#name ⇒ Object
The name of this leaf in its parent field.
Instance Method Summary collapse
-
#initialize(field = nil, name = nil) ⇒ Variable
constructor
A new instance of Variable.
-
#path ⇒ Object
Returns the full path of this leaf w.r.t.
Constructor Details
#initialize(field = nil, name = nil) ⇒ Variable
Returns a new instance of Variable.
60 61 62 |
# File 'lib/roby/state/open_struct_model.rb', line 60 def initialize(field = nil, name = nil) @field, @name = field, name end |
Instance Attribute Details
#field ⇒ Object
The parent field
58 59 60 |
# File 'lib/roby/state/open_struct_model.rb', line 58 def field @field end |
#name ⇒ Object
The name of this leaf in its parent field
55 56 57 |
# File 'lib/roby/state/open_struct_model.rb', line 55 def name @name end |
Instance Method Details
#path ⇒ Object
Returns the full path of this leaf w.r.t. the root of the state structure
66 67 68 69 70 |
# File 'lib/roby/state/open_struct_model.rb', line 66 def path path = field.path.dup path << name path end |