Module: Strum::Pipeline::ClassMethods
- Defined in:
- lib/strum/pipeline.rb
Overview
class methods
Instance Method Summary collapse
- #bind_to_pipeline(value) ⇒ Object
- #init(message_type, message_binding, handler = nil) ⇒ Object
- #inits ⇒ Object
- #pipeline_name ⇒ Object
- #step(message_type, message_binding, handler = nil) ⇒ Object
- #ttl(interval) ⇒ Object
Instance Method Details
#bind_to_pipeline(value) ⇒ Object
72 73 74 |
# File 'lib/strum/pipeline.rb', line 72 def bind_to_pipeline(value) Strum::Pipeline.config.bind_to_pipeline = value end |
#init(message_type, message_binding, handler = nil) ⇒ Object
80 81 82 83 |
# File 'lib/strum/pipeline.rb', line 80 def init(, , handler = nil) bind_to(pipeline_name, , , handler) if Strum::Pipeline.config.bind_to_pipeline inits << handler_key(, ) end |
#inits ⇒ Object
76 77 78 |
# File 'lib/strum/pipeline.rb', line 76 def inits @inits ||= [] end |
#pipeline_name ⇒ Object
96 97 98 99 100 101 102 103 104 |
# File 'lib/strum/pipeline.rb', line 96 def pipeline_name word = name.dup word.gsub!(/::/, "_") word.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') word.gsub!(/([a-z\d])([A-Z])/, '\1_\2') word.tr!("-", "_") word.downcase! word end |
#step(message_type, message_binding, handler = nil) ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/strum/pipeline.rb', line 85 def step(, , handler = nil) return unless Strum::Pipeline.config.bind_to_pipeline bind_to(pipeline_name, , , handler) do |bindings| bindings[:pipeline] ||= {} bindings[:pipeline][:name] = pipeline_name bindings[:pipeline][] ||= [] bindings[:pipeline][] << end end |