Class: Busted::Profiler::Default
- Inherits:
-
Object
- Object
- Busted::Profiler::Default
- Defined in:
- lib/busted/profiler/default.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
Attributes included from Countable
Attributes included from Traceable
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ Default
constructor
A new instance of Default.
- #run ⇒ Object
Methods included from Countable
#finish_counter, #start_counter
Methods included from Traceable
#finish_tracer, #start_tracer, #trace?
Constructor Details
#initialize(options = {}, &block) ⇒ Default
Returns a new instance of Default.
14 15 16 17 18 19 20 |
# File 'lib/busted/profiler/default.rb', line 14 def initialize( = {}, &block) fail LocalJumpError, "no block given" unless block @trace = .fetch :trace, false @block = block @report = {} end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
8 9 10 |
# File 'lib/busted/profiler/default.rb', line 8 def block @block end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
8 9 10 |
# File 'lib/busted/profiler/default.rb', line 8 def report @report end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
8 9 10 |
# File 'lib/busted/profiler/default.rb', line 8 def trace @trace end |
Class Method Details
.run(options = {}, &block) ⇒ Object
10 11 12 |
# File 'lib/busted/profiler/default.rb', line 10 def self.run( = {}, &block) new(, &block).run end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/busted/profiler/default.rb', line 22 def run start_tracer start_counter block.call finish_counter finish_tracer report end |