Class: Wukong::DataflowBuilder
- Inherits:
-
Hanuman::TreeBuilder
- Object
- Hanuman::StageBuilder
- Hanuman::GraphBuilder
- Hanuman::TreeBuilder
- Wukong::DataflowBuilder
- Defined in:
- lib/wukong/dataflow.rb
Constant Summary
Constants included from Hanuman::TreeInstanceMethods
Hanuman::TreeInstanceMethods::MultipleRoots
Instance Attribute Summary
Attributes included from Hanuman::StageInstanceMethods
Instance Method Summary collapse
- #description(desc = nil) ⇒ Object
- #handle_dsl_arguments_for(stage, *args, &action) ⇒ Object
- #method_missing(name, *args, &blk) ⇒ Object
- #namespace ⇒ Object
Methods included from Hanuman::TreeInstanceMethods
#add_link, #ancestor, #append, #directed_sort, #each_stage, #leaves, #prepend, #root, #tsort_each_child, #tsort_each_node
Methods inherited from Hanuman::GraphBuilder
#build, #clone, #define, #extract_links!, #serialize, #stage_specific_options
Methods included from Hanuman::GraphInstanceMethods
#add_link, #add_stage, #ancestors, #descendents, #each_stage, #has_link?
Methods inherited from Hanuman::StageBuilder
#build, #clone, #define, #define_class, #handle_extra_attributes, #into, #merge!, #serialize
Methods included from Hanuman::StageInstanceMethods
#add_stage_link, #linkable_name, #root
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blk) ⇒ Object
82 83 84 85 86 87 88 |
# File 'lib/wukong/dataflow.rb', line 82 def method_missing(name, *args, &blk) if stages[name] handle_dsl_arguments_for(stages[name], *args, &blk) else super end end |
Instance Method Details
#description(desc = nil) ⇒ Object
59 60 61 62 |
# File 'lib/wukong/dataflow.rb', line 59 def description desc=nil @description = desc if desc @description end |
#handle_dsl_arguments_for(stage, *args, &action) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/wukong/dataflow.rb', line 66 def handle_dsl_arguments_for(stage, *args, &action) = args. while stages.include?(stage.label) parts = stage.label.to_s.split('_') if parts.last.to_i > 0 parts[-1] = parts.last.to_i + 1 else parts.push(1) end stage.label = parts.map(&:to_s).join('_').to_sym end stage.merge!(.merge(action: action).compact) stage.graph = self stage end |