Class: PiecePipe::DebugStep
Instance Attribute Summary
Attributes inherited from Step
Instance Method Summary collapse
-
#initialize(opts = {}, &block) ⇒ DebugStep
constructor
A new instance of DebugStep.
- #process(item) ⇒ Object
Methods inherited from Step
Constructor Details
#initialize(opts = {}, &block) ⇒ DebugStep
Returns a new instance of DebugStep.
3 4 5 6 |
# File 'lib/piece_pipe/debug_step.rb', line 3 def initialize(opts={},&block) @opts = opts @block = block end |
Instance Method Details
#process(item) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/piece_pipe/debug_step.rb', line 8 def process(item) title = @opts[:title] || "DEBUG:" if @opts[:inspect_keys] puts "#{title} #{item.slice(*@opts[:inspect_keys])}" end @block.call if @block produce item end |