Class: Gruf::Timer::Result
- Inherits:
-
Object
- Object
- Gruf::Timer::Result
- Defined in:
- lib/gruf/timer.rb
Overview
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Result The result of the block that was called.
-
#time ⇒ Float
readonly
Time The time, in ms, of the block execution.
Instance Method Summary collapse
-
#initialize(result, time) ⇒ Result
constructor
Initialize the result object.
-
#success? ⇒ Boolean
Was this result a successful result?.
Constructor Details
#initialize(result, time) ⇒ Result
Initialize the result object
43 44 45 46 |
# File 'lib/gruf/timer.rb', line 43 def initialize(result, time) @result = result @time = time.to_f end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns result The result of the block that was called.
33 34 35 |
# File 'lib/gruf/timer.rb', line 33 def result @result end |
#time ⇒ Float (readonly)
Returns time The time, in ms, of the block execution.
35 36 37 |
# File 'lib/gruf/timer.rb', line 35 def time @time end |
Instance Method Details
#success? ⇒ Boolean
Was this result a successful result?
53 54 55 |
# File 'lib/gruf/timer.rb', line 53 def success? !result.is_a?(GRPC::BadStatus) end |