Class: RubyProf::AggregateCallInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-prof/aggregate_call_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_infosObject (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

#calledObject



48
49
50
# File 'lib/ruby-prof/aggregate_call_info.rb', line 48

def called
  aggregate(:called)
end

#childrenObject



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_timeObject



44
45
46
# File 'lib/ruby-prof/aggregate_call_info.rb', line 44

def children_time
  aggregate_without_recursion(:children_time)
end

#lineObject



22
23
24
# File 'lib/ruby-prof/aggregate_call_info.rb', line 22

def line
  call_infos.first.line
end

#parentObject



18
19
20
# File 'lib/ruby-prof/aggregate_call_info.rb', line 18

def parent
  call_infos.first.parent
end

#self_timeObject



36
37
38
# File 'lib/ruby-prof/aggregate_call_info.rb', line 36

def self_time
  aggregate_without_recursion(:self_time)
end

#targetObject



14
15
16
# File 'lib/ruby-prof/aggregate_call_info.rb', line 14

def target
  call_infos.first.target
end

#to_sObject



52
53
54
# File 'lib/ruby-prof/aggregate_call_info.rb', line 52

def to_s
  "#{call_infos.first.target.full_name}"
end

#total_timeObject



32
33
34
# File 'lib/ruby-prof/aggregate_call_info.rb', line 32

def total_time
  aggregate_without_recursion(:total_time)
end

#wait_timeObject



40
41
42
# File 'lib/ruby-prof/aggregate_call_info.rb', line 40

def wait_time
  aggregate_without_recursion(:wait_time)
end