Class: Timify::Trace
- Inherits:
-
Object
- Object
- Timify::Trace
- Defined in:
- lib/timify/trace.rb
Overview
Result of trace: the block's return value and the timer used to measure it.
Instance Attribute Summary collapse
-
#timer ⇒ Timify
readonly
The timer created for the block.
-
#value ⇒ Object
readonly
The block's return value.
Instance Method Summary collapse
-
#initialize(value:, timer:) ⇒ Trace
constructor
A new instance of Trace.
- #totals(**options) ⇒ Hash, String
Constructor Details
#initialize(value:, timer:) ⇒ Trace
Returns a new instance of Trace.
14 15 16 17 |
# File 'lib/timify/trace.rb', line 14 def initialize(value:, timer:) @value = value @timer = timer end |
Instance Attribute Details
#timer ⇒ Timify (readonly)
Returns the timer created for the block.
10 11 12 |
# File 'lib/timify/trace.rb', line 10 def timer @timer end |
#value ⇒ Object (readonly)
Returns the block's return value.
7 8 9 |
# File 'lib/timify/trace.rb', line 7 def value @value end |
Instance Method Details
#totals(**options) ⇒ Hash, String
Delegates to Timify#totals on #timer.
23 24 25 |
# File 'lib/timify/trace.rb', line 23 def totals(**) @timer.totals(**) end |