Module YARD::CodeObjects::NamespaceMapper
In: lib/yard/code_objects/namespace_mapper.rb

This module controls registration and accessing of namespace separators for {Registry} lookup.

@since 0.9.1

Methods

Attributes

default_separator  [RW]  @return [String] the default separator when no separator can begin
  determined.

Public Class methods

Invalidates all separators @return [void]

@return [Hash] a mapping of types to separators

@return [Regexp] the full list of separators as a regexp match

@return [Hash] a reverse mapping of separators to types

Public Instance methods

Clears the map of separators.

@return [void]

Gets or sets the default separator value to use when no separator for the namespace can be determined.

@param value [String, nil] the default separator, or nil to return the

  value

@example

  default_separator "::"

Registers a separator with an optional set of valid types that must follow the separator lexically.

@param sep [String] the separator string for the namespace @param valid_types [Array<Symbol>] a list of object types that

  must follow the separator. If the list is empty, any type can
  follow the separator.

@example Registering separators for a method object

  # Anything after a "#" denotes a method object
  register_separator "#", :method
  # Anything after a "." denotes a method object
  register_separator ".", :method

@return [Array<String>] all of the registered separators

@param type [String] the type to return separators for @return [Array<Symbol>] a list of separators registered to a type

@return [Regexp] the regexp match of all separators

@param sep [String] the separator to return types for @return [Array<Symbol>] a list of types registered to a separator

[Validate]