Class: OroGen::Spec::TaskModelExtension
- Inherits:
-
Object
- Object
- OroGen::Spec::TaskModelExtension
- Defined in:
- lib/orogen/spec/task_context.rb
Overview
Base class for all task model extensions. It provides a few useful common methods
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ TaskModelExtension
constructor
A new instance of TaskModelExtension.
-
#registered_on(task_context) ⇒ Object
Called at registration time so that the extension can apply some default stuff.
- #supercall(default, m, *args, &block) ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ TaskModelExtension
Returns a new instance of TaskModelExtension
18 19 20 |
# File 'lib/orogen/spec/task_context.rb', line 18 def initialize(name = nil) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name
15 16 17 |
# File 'lib/orogen/spec/task_context.rb', line 15 def name @name end |
#task ⇒ Object (readonly)
Returns the value of attribute task
16 17 18 |
# File 'lib/orogen/spec/task_context.rb', line 16 def task @task end |
Instance Method Details
#registered_on(task_context) ⇒ Object
Called at registration time so that the extension can apply some default stuff
35 36 37 |
# File 'lib/orogen/spec/task_context.rb', line 35 def registered_on(task_context) @task = task_context end |
#supercall(default, m, *args, &block) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/orogen/spec/task_context.rb', line 22 def supercall(default, m, *args, &block) if !task.superclass default elsif self.name && @super_ext || (@super_ext = task.superclass.find_extension(self.name)) @super_ext.send(m, *args, &block) else default end end |