Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.
parse_name(name)public
Extracts the class, selector and method name parts from name like Foo::Bar#baz.
NOTE: Given Foo::Bar, Bar is considered a class even though it may be a method
# File lib/rdoc/ri/driver.rb, line 1319
def parse_name name
parts = name.split(/(::?|#|\.)/)
if parts.length == 1 then
if parts.first =~ /^[a-z]|^([%&*+\/<>^`|~-]|\+@|-@|<<|<=>?|===?|=>|=~|>>|\[\]=?|~@)$/ then
type = '.'
meth = parts.pop
else
type = nil
meth = nil
end
elsif parts.length == 2 or parts.last =~ /::|#|\./ then
type = parts.pop
meth = nil
elsif parts[1] == ':' then
klass = parts.shift
type = parts.shift
meth = parts.join
elsif parts[-2] != '::' or parts.last !~ /^[A-Z]/ then
meth = parts.pop
type = parts.pop
end
klass ||= parts.join
[klass, type, meth]
end Related methods
- Instance methods
- add_also_in
- add_class
- add_extends
- add_extension_modules
- add_extension_modules_multiple
- add_extension_modules_single
- add_from
- add_includes
- add_method
- add_method_documentation
- add_method_list
- ancestors_of
- class_cache
- class_document
- class_document_comment
- class_document_constants
- classes
- classes_and_includes_and_extends_for
- complete
- complete_klass
- complete_method
- display
- display_class
- display_method
- display_name
- display_names
- display_page
- display_page_list
- expand_class
- expand_name
- filter_methods
- find_methods
- find_pager_jruby
- find_store
- formatter
- in_path?
- interactive
- list_known_classes
- list_methods_matching
- load_method
- load_methods_matching
- lookup_method
- method_document
- method_type
- name_regexp
- page
- paging?
- parse_name
- render_class
- render_method
- render_method_arguments
- render_method_comment
- render_method_superclass
- run
- setup_pager
- start_server
- Class methods
- default_options
- dump
- new
- process_args
- run