Class: Leftovers::Processors::Each

Inherits:
Object
  • Object
show all
Includes:
ComparableInstance
Defined in:
lib/leftovers/processors/each.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

Constructor Details

#initialize(processors) ⇒ Each

Returns a new instance of Each.



10
11
12
13
14
# File 'lib/leftovers/processors/each.rb', line 10

def initialize(processors)
  @processors = processors

  freeze
end

Instance Attribute Details

#processorsObject (readonly)

Returns the value of attribute processors.



8
9
10
# File 'lib/leftovers/processors/each.rb', line 8

def processors
  @processors
end

Instance Method Details

#process(str, current_node, matched_node, acc) ⇒ Object



16
17
18
19
20
# File 'lib/leftovers/processors/each.rb', line 16

def process(str, current_node, matched_node, acc)
  @processors.each do |processor|
    processor.process(str, current_node, matched_node, acc)
  end
end