Method: Pry::Method#source

Defined in:
lib/pry/method.rb

#sourceString?

Returns The source code of the method, or ‘nil` if it’s unavailable.

Returns:

  • (String, nil)

    The source code of the method, or ‘nil` if it’s unavailable.



304
305
306
307
308
309
310
311
# File 'lib/pry/method.rb', line 304

def source
  @source ||= case source_type
              when :c
                c_source
              when :ruby
                ruby_source
              end
end