method
display_method
v1_9_2_180 -
Show latest stable
- Class:
RDoc::RI::Driver
display_method(name)public
Outputs formatted RI data for method name
# File lib/rdoc/ri/driver.rb, line 641
def display_method name
found = load_methods_matching name
raise NotFoundError, name if found.empty?
out = RDoc::Markup::Document.new
out << RDoc::Markup::Heading.new(1, name)
out << RDoc::Markup::BlankLine.new
found.each do |store, methods|
methods.each do |method|
out << RDoc::Markup::Paragraph.new("(from #{store.friendly_path})")
unless name =~ /^#{Regexp.escape method.parent_name}/ then
out << RDoc::Markup::Heading.new(3, "Implementation from #{method.parent_name}")
end
out << RDoc::Markup::Rule.new(1)
if method.arglists then
arglists = method.arglists.chomp.split "\n"
arglists = arglists.map { |line| [' ', line, "\n"] }
out << RDoc::Markup::Verbatim.new(*arglists.flatten)
out << RDoc::Markup::Rule.new(1)
end
out << RDoc::Markup::BlankLine.new
out << method.comment
out << RDoc::Markup::BlankLine.new
end
end
display out
end Related methods
- Instance methods
- add_also_in
- add_class
- add_from
- add_includes
- add_method_list
- ancestors_of
- class_cache
- classes
- complete
- display
- display_class
- display_method
- display_name
- display_names
- expand_class
- expand_name
- find_methods
- formatter
- interactive
- list_known_classes
- list_methods_matching
- load_method
- load_methods_matching
- method_type
- page
- paging?
- parse_name
- run
- setup_pager
- Class methods
- default_options
- dump
- new
- process_args
- run