Class: Busted::Profiler::Sandwich
- Inherits:
-
Object
- Object
- Busted::Profiler::Sandwich
- Defined in:
- lib/busted/profiler/sandwich.rb
Constant Summary collapse
- VALID_ACTIONS =
[:start, :finish].freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#trace ⇒ Object
Returns the value of attribute trace.
Attributes included from Countable
Attributes included from Traceable
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Countable
#finish_counter, #start_counter
Methods included from Traceable
#finish_tracer, #start_tracer, #trace?
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
14 15 16 |
# File 'lib/busted/profiler/sandwich.rb', line 14 def action @action end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
15 16 17 |
# File 'lib/busted/profiler/sandwich.rb', line 15 def report @report end |
#trace ⇒ Object
Returns the value of attribute trace.
15 16 17 |
# File 'lib/busted/profiler/sandwich.rb', line 15 def trace @trace end |
Class Method Details
.run(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/busted/profiler/sandwich.rb', line 17 def self.run( = {}) action = .fetch :action, false trace = .fetch :trace, false unless VALID_ACTIONS.include? action fail ArgumentError, "profiler requires start or finish action" end sandwich = instance sandwich.action = action sandwich.trace = trace sandwich.run end |
Instance Method Details
#run ⇒ Object
32 33 34 |
# File 'lib/busted/profiler/sandwich.rb', line 32 def run send action end |