Class: Piah::ProcessorList
- Inherits:
-
Object
- Object
- Piah::ProcessorList
- Defined in:
- lib/piah/processor_list.rb
Instance Method Summary collapse
-
#initialize(*processors) ⇒ ProcessorList
constructor
A new instance of ProcessorList.
- #process(p, args) ⇒ Object
- #types ⇒ Object
Constructor Details
#initialize(*processors) ⇒ ProcessorList
Returns a new instance of ProcessorList.
3 4 5 |
# File 'lib/piah/processor_list.rb', line 3 def initialize(*processors) @processors = processors.flatten end |
Instance Method Details
#process(p, args) ⇒ Object
11 12 13 |
# File 'lib/piah/processor_list.rb', line 11 def process(p,args) @processors[p].process args end |
#types ⇒ Object
7 8 9 |
# File 'lib/piah/processor_list.rb', line 7 def types @types ||= @processors.each_index.zip(@processors.map(&:types)).to_h end |