Class: Roby::GoalVariableModel

Inherits:
OpenStructModel::Variable show all
Defined in:
lib/roby/state/goal_model.rb

Overview

Representation of a state variable in the goal structure

Instance Attribute Summary collapse

Attributes inherited from OpenStructModel::Variable

#field, #name

Instance Method Summary collapse

Methods inherited from OpenStructModel::Variable

#initialize, #path

Constructor Details

This class inherits a constructor from Roby::OpenStructModel::Variable

Instance Attribute Details

#readerObject

Accessor object. It must respond to #call(task) and return the state variable. Note that if the associated state model defines a type, the return value must be of this type



19
20
21
# File 'lib/roby/state/goal_model.rb', line 19

def reader
  @reader
end

Instance Method Details

#call(task) ⇒ Object



28
29
30
# File 'lib/roby/state/goal_model.rb', line 28

def call(task)
    reader.call(task)
end

#to_goal_variable_model(field, name) ⇒ Object



21
22
23
24
25
26
# File 'lib/roby/state/goal_model.rb', line 21

def to_goal_variable_model(field, name)
    result = dup
    result.field = field
    result.name = name
    result
end