Class: Taski::Section
Class Method Summary collapse
-
.cached_dependencies ⇒ Object
Section does not have static dependencies for execution.
- .interfaces(*interface_methods) ⇒ Object
Instance Method Summary collapse
-
#impl ⇒ Class
The implementation task class.
- #run ⇒ Object
Methods inherited from Task
#clean, clean, clear_dependency_cache, coordinator, exported_methods, exports, new, registry, reset!, #reset!, run, tree
Class Method Details
.cached_dependencies ⇒ Object
Section does not have static dependencies for execution. The impl method is called at runtime to determine the actual implementation. Static dependencies (impl candidates) are only used for tree display and circular detection.
16 17 18 |
# File 'lib/taski/section.rb', line 16 def cached_dependencies Set.new end |
.interfaces(*interface_methods) ⇒ Object
9 10 11 |
# File 'lib/taski/section.rb', line 9 def interfaces(*interface_methods) exports(*interface_methods) end |
Instance Method Details
#impl ⇒ Class
Returns The implementation task class.
37 38 39 |
# File 'lib/taski/section.rb', line 37 def impl raise NotImplementedError, "Subclasses must implement the impl method to return implementation class" end |
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/taski/section.rb', line 21 def run implementation_class = impl unless implementation_class raise "Section #{self.class} does not have an implementation. Override 'impl' method." end apply_interface_to_implementation(implementation_class) self.class.exported_methods.each do |method| value = implementation_class.public_send(method) instance_variable_set("@#{method}", value) end end |