Class: Roby::StateVariableModel

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

Overview

Representation of a leaf in the state model

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

#data_sourceObject

Returns a data source for that field

At this level, the format data source is unspecified. It is meant to be used by other mechanisms to fill the data_source tree in the state object (this is the state model)



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

def data_source
  @data_source
end

#typeObject

Returns the type of this field. nil means any type. It is matched against values using #===



21
22
23
# File 'lib/roby/state/state_model.rb', line 21

def type
  @type
end

Instance Method Details

#to_state_variable_model(field, name) ⇒ Object



30
31
32
33
34
35
# File 'lib/roby/state/state_model.rb', line 30

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