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



17
18
19
# File 'lib/roby/state/goal_model.rb', line 17

def reader
  @reader
end

Instance Method Details

#call(task) ⇒ Object



26
27
28
# File 'lib/roby/state/goal_model.rb', line 26

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

#to_goal_variable_model(field, name) ⇒ Object



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

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