Class: PiecePipe::TapStep

Inherits:
Step
  • Object
show all
Defined in:
lib/piece_pipe/tap_step.rb

Instance Attribute Summary

Attributes inherited from Step

#source

Instance Method Summary collapse

Methods inherited from Step

#to_enum

Constructor Details

#initialize(&block) ⇒ TapStep

Returns a new instance of TapStep.



3
4
5
# File 'lib/piece_pipe/tap_step.rb', line 3

def initialize(&block)
  @block = block
end

Instance Method Details

#process(item) ⇒ Object



7
8
9
10
# File 'lib/piece_pipe/tap_step.rb', line 7

def process(item)
  @block.call item
  produce item
end