Class: Call
- Inherits:
-
Object
- Object
- Call
- Defined in:
- lib/call.rb
Instance Attribute Summary collapse
-
#class_id ⇒ Object
readonly
Returns the value of attribute class_id.
-
#finish_time ⇒ Object
Returns the value of attribute finish_time.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#method_id ⇒ Object
readonly
Returns the value of attribute method_id.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
- #execute_time ⇒ Object
- #finish ⇒ Object
-
#initialize(event) ⇒ Call
constructor
A new instance of Call.
- #key?(key) ⇒ Boolean
Constructor Details
#initialize(event) ⇒ Call
Returns a new instance of Call.
5 6 7 8 9 10 |
# File 'lib/call.rb', line 5 def initialize(event) @start_time = Time.now.to_f @class_id = event.defined_class @method_id = event.method_id @key = generate_key end |
Instance Attribute Details
#class_id ⇒ Object (readonly)
Returns the value of attribute class_id.
2 3 4 |
# File 'lib/call.rb', line 2 def class_id @class_id end |
#finish_time ⇒ Object
Returns the value of attribute finish_time.
3 4 5 |
# File 'lib/call.rb', line 3 def finish_time @finish_time end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
2 3 4 |
# File 'lib/call.rb', line 2 def key @key end |
#method_id ⇒ Object (readonly)
Returns the value of attribute method_id.
2 3 4 |
# File 'lib/call.rb', line 2 def method_id @method_id end |
#start_time ⇒ Object
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/call.rb', line 3 def start_time @start_time end |
Instance Method Details
#execute_time ⇒ Object
17 18 19 |
# File 'lib/call.rb', line 17 def execute_time @finish_time.to_f - @start_time end |
#finish ⇒ Object
12 13 14 15 |
# File 'lib/call.rb', line 12 def finish @finish_time ||= Time.now.to_f execute_time end |
#key?(key) ⇒ Boolean
21 22 23 |
# File 'lib/call.rb', line 21 def key?(key) @key == key end |