Module: Roby::Coordination::Models::ActionScript
- Included in:
- ActionScript
- Defined in:
- lib/roby/coordination/models/action_script.rb
Overview
Definition of model-level functionality for action scripts
Action scripts are sequential representations of action coordinations. Each step is a script instruction (created with one of the API calls in Script) whose argument is a Task object. The Task object represents the actual work that will be done there
Action script models are usually created through an action interface with Interface#action_script. The script model can then be retrieved using Actions::Models::Action#coordination_model.
Instance Attribute Summary
Attributes included from Actions
Attributes included from Base
Instance Method Summary collapse
Methods included from Script
#add, #call, #emit, #execute, #instructions, #sleep, #start, #terminal, #terminal?, #timeout_start, #timeout_stop, #wait
Methods included from Actions
#dependency, #depends_on, #event_active_in_state?, #forward, #from, #from_state, #map_tasks, #parse, #rebind, #required_tasks_for, #root_event?, #setup_submodel, #toplevel_state?
Methods included from Base
#find_event, #find_task_by_name, #map_tasks, #parse_names, #setup_submodel, #task, #task_model, #use_fault_response_table, #used_fault_response_table, #validate_event, #validate_or_create_task, #validate_task
Methods included from Arguments
#argument, #validate_arguments
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/roby/coordination/models/action_script.rb', line 53 def method_missing(m, *args) if m =~ /(.*)!/ action_name = $1 action = action_interface.find_action_by_name(action_name) task = task(action.new(*args)) task.name = action_name execute(task) else super end end |
Instance Method Details
#respond_to_missing?(m, include_private) ⇒ Boolean
45 46 47 48 49 50 51 |
# File 'lib/roby/coordination/models/action_script.rb', line 45 def respond_to_missing?(m, include_private) if m =~ /(.*)!/ action_interface&.find_action_by_name(m.to_s) else super end end |