Method: Pry::Method#doc

Defined in:
lib/pry/method.rb

#docString?

Returns The documentation for the method, or ‘nil` if it’s unavailable.

Returns:

  • (String, nil)

    The documentation for the method, or ‘nil` if it’s unavailable.



329
330
331
332
333
334
335
336
337
338
# File 'lib/pry/method.rb', line 329

def doc
  @doc ||=
    case source_type
    when :c
      info = pry_doc_info
      info.docstring if info
    when :ruby
      get_comment_content(comment)
    end
end