# File lib/pry/method.rb, line 262 def doc @doc ||= case source_type when :c info = pry_doc_info info.docstring if info when :ruby if Helpers::BaseHelpers.rbx? && core? strip_leading_hash_and_whitespace_from_ruby_comments(core_doc) elsif pry_method? raise CommandError, "Can't view doc for a REPL-defined method." else strip_leading_hash_and_whitespace_from_ruby_comments(@method.comment) end end end