Class: Roby::OpenStructModel::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/roby/state/open_struct_model.rb

Overview

Base implementation for “leaf” values in an extended struct model

Direct Known Subclasses

GoalVariableModel, StateVariableModel

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fieldObject

The parent field



58
59
60
# File 'lib/roby/state/open_struct_model.rb', line 58

def field
  @field
end

#nameObject

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

#pathObject

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