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.
7 8 9 10 11 12 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 7 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.
5 6 7 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 5 def call_infos @call_infos end |
Instance Method Details
#called ⇒ Object
48 49 50 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 48 def called aggregate(:called) end |
#children ⇒ Object
26 27 28 29 30 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 26 def children call_infos.inject(Array.new) do |result, call_info| result.concat(call_info.children) end end |
#children_time ⇒ Object
44 45 46 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 44 def children_time aggregate_without_recursion(:children_time) end |
#line ⇒ Object
22 23 24 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 22 def line call_infos.first.line end |
#parent ⇒ Object
18 19 20 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 18 def parent call_infos.first.parent end |
#self_time ⇒ Object
36 37 38 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 36 def self_time aggregate_without_recursion(:self_time) end |
#target ⇒ Object
14 15 16 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 14 def target call_infos.first.target end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 52 def to_s "#{call_infos.first.target.full_name}" end |
#total_time ⇒ Object
32 33 34 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 32 def total_time aggregate_without_recursion(:total_time) end |
#wait_time ⇒ Object
40 41 42 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 40 def wait_time aggregate_without_recursion(:wait_time) end |