Class: RubyProf::AggregateCallInfo
- Inherits:
-
Object
- Object
- RubyProf::AggregateCallInfo
- Defined in:
- lib/ruby-prof/aggregate_call_info.rb
Instance Attribute Summary collapse
-
#call_infos ⇒ Object
readonly
Returns the value of attribute call_infos.
Instance Method Summary collapse
- #called ⇒ Object
- #children ⇒ Object
- #children_time ⇒ Object
-
#initialize(call_infos) ⇒ AggregateCallInfo
constructor
A new instance of AggregateCallInfo.
- #line ⇒ Object
- #parent ⇒ Object
- #self_time ⇒ Object
- #target ⇒ Object
- #to_s ⇒ Object
- #total_time ⇒ Object
- #wait_time ⇒ Object
Constructor Details
#initialize(call_infos) ⇒ AggregateCallInfo
Returns a new instance of AggregateCallInfo.
4 5 6 7 8 9 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 4 def initialize(call_infos) if call_infos.length == 0 raise(ArgumentError, "Must specify at least one call info.") end @call_infos = call_infos end |
Instance Attribute Details
#call_infos ⇒ Object (readonly)
Returns the value of attribute call_infos.
3 4 5 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 3 def call_infos @call_infos end |
Instance Method Details
#called ⇒ Object
45 46 47 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 45 def called aggregate(:called) end |
#children ⇒ Object
23 24 25 26 27 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 23 def children call_infos.inject(Array.new) do |result, call_info| result.concat(call_info.children) end end |
#children_time ⇒ Object
41 42 43 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 41 def children_time aggregate_minimal(:children_time) end |
#line ⇒ Object
19 20 21 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 19 def line call_infos.first.line end |
#parent ⇒ Object
15 16 17 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 15 def parent call_infos.first.parent end |
#self_time ⇒ Object
33 34 35 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 33 def self_time aggregate(:self_time) end |
#target ⇒ Object
11 12 13 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 11 def target call_infos.first.target end |
#to_s ⇒ Object
49 50 51 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 49 def to_s "#{call_infos.first.full_name}" end |
#total_time ⇒ Object
29 30 31 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 29 def total_time aggregate_minimal(:total_time) end |
#wait_time ⇒ Object
37 38 39 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 37 def wait_time aggregate(:wait_time) end |