Class: Xcprofiler::BlockReporter

Inherits:
AbstractReporter show all
Defined in:
lib/xcprofiler/reporters/block_reporter.rb

Constant Summary

Constants inherited from AbstractReporter

AbstractReporter::DEFAULT_TRUNCATE_AT

Instance Attribute Summary

Attributes inherited from AbstractReporter

#options

Instance Method Summary collapse

Methods inherited from AbstractReporter

#filter_executions

Constructor Details

#initialize(options = {}, &block) ⇒ BlockReporter

Returns a new instance of BlockReporter.

Raises:

  • (ArgumentError)


3
4
5
6
7
# File 'lib/xcprofiler/reporters/block_reporter.rb', line 3

def initialize(options = {}, &block)
  raise ArgumentError, '[BlockReporter] block must be passed' unless block_given?
  super(options)
  @block = block
end

Instance Method Details

#report!(executions) ⇒ Object



9
10
11
# File 'lib/xcprofiler/reporters/block_reporter.rb', line 9

def report!(executions)
  @block.call(executions)
end