Class: BigBench::PostProcessor::Processor
- Inherits:
-
Object
- Object
- BigBench::PostProcessor::Processor
- Includes:
- ActionView::Helpers
- Defined in:
- lib/bigbench/post_processor.rb
Overview
A single processor, be it a block or a module is always mapped into this class
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#proc ⇒ Object
Returns the value of attribute proc.
-
#runs ⇒ Object
Returns the value of attribute runs.
Instance Method Summary collapse
-
#initialize(processor = nil, options = {}, &block) ⇒ Processor
constructor
Creates the processor with the block or a processor.
-
#run! ⇒ Object
Run the block of code or the run! method of the processor.
Constructor Details
#initialize(processor = nil, options = {}, &block) ⇒ Processor
Creates the processor with the block or a processor
70 71 72 73 |
# File 'lib/bigbench/post_processor.rb', line 70 def initialize(processor = nil, = {}, &block) @proc = processor_to_proc(processor) || block @runs, @options = 0, end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
67 68 69 |
# File 'lib/bigbench/post_processor.rb', line 67 def @options end |
#proc ⇒ Object
Returns the value of attribute proc.
65 66 67 |
# File 'lib/bigbench/post_processor.rb', line 65 def proc @proc end |
#runs ⇒ Object
Returns the value of attribute runs.
66 67 68 |
# File 'lib/bigbench/post_processor.rb', line 66 def runs @runs end |
Instance Method Details
#run! ⇒ Object
Run the block of code or the run! method of the processor
76 77 78 79 |
# File 'lib/bigbench/post_processor.rb', line 76 def run! @runs += 1 Context.module_exec(@options, &@proc) end |