Class: Peeek::Calls

Inherits:
Array
  • Object
show all
Defined in:
lib/peeek/calls.rb

Instance Method Summary collapse

Instance Method Details

#at(line) ⇒ Peeek::Calls

Filter the calls by line number.



16
17
18
# File 'lib/peeek/calls.rb', line 16

def at(line)
  Calls.new(select { |call| line === call.line })
end

#exceptionsPeeek::Calls

Filter only the calls that an exception raised.



38
39
40
# File 'lib/peeek/calls.rb', line 38

def exceptions
  Calls.new(select(&:raised?))
end

#from(receiver) ⇒ Peeek::Calls

Filter the calls by a receiver.



24
25
26
# File 'lib/peeek/calls.rb', line 24

def from(receiver)
  Calls.new(select { |call| call.receiver == receiver })
end

#in(file) ⇒ Peeek::Calls

Filter the calls by name of a file.



8
9
10
# File 'lib/peeek/calls.rb', line 8

def in(file)
  Calls.new(select { |call| file === call.file })
end

#return_valuesPeeek::Calls

Filter only the calls that a value returned.



31
32
33
# File 'lib/peeek/calls.rb', line 31

def return_values
  Calls.new(select(&:returned?))
end