Class: Piah::ProcessorList

Inherits:
Object
  • Object
show all
Defined in:
lib/piah/processor_list.rb

Instance Method Summary collapse

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

#typesObject



7
8
9
# File 'lib/piah/processor_list.rb', line 7

def types
  @types ||= @processors.each_index.zip(@processors.map(&:types)).to_h
end