Method: Pry::Method#source_line

Defined in:
lib/pry/method.rb

#source_lineFixnum?

Returns The line of code in ‘source_file` which begins the method’s definition, or ‘nil` if that information is unavailable.

Returns:

  • (Fixnum, nil)

    The line of code in ‘source_file` which begins the method’s definition, or ‘nil` if that information is unavailable.



361
362
363
# File 'lib/pry/method.rb', line 361

def source_line
  source_location.nil? ? nil : source_location.last
end