lib/yard/code_objects/namespace_mapper.rb
# Registers a separator with an optional set of valid types that
# must follow the separator lexically.
#
# Calls all callbacks defined by {NamespaceMapper.on_invalidate} after
# the separator is registered.
#
# @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
# @see .on_invalidate
Registers a separator with an optional set of valid types that
must follow the separator lexically.

Calls all callbacks defined by {NamespaceMapper.on_invalidate} after
the separator is registered.
Registers a separator with an optional set of valid types that must follow the separator lexically . Calls all callbacks defined by { NamespaceMapper . on_invalidate } after the separator is registered .
def register_separator(sep, *valid_types)
        NamespaceMapper.invalidate
        valid_types.each do |t|
          NamespaceMapper.rev_map[t] ||= []
          NamespaceMapper.rev_map[t] << sep
        end
        NamespaceMapper.map[sep] ||= []
        NamespaceMapper.map[sep] += valid_types
      end
def register_separator ( sep , * valid_types ) NamespaceMapper . invalidate valid_types . each do | t | NamespaceMapper . rev_map [ t ] ||= [ ] NamespaceMapper . rev_map [ t ] << sep end NamespaceMapper . map [ sep ] ||= [ ] NamespaceMapper . map [ sep ] += valid_types end
Registers a separator with an optional set of valid types that
must follow the separator lexically.
Registers a separator with an optional set of valid types that must follow the separator lexically .
sep
the separator string for the namespace
the separator string for the namespace
valid_types
a list of object types that must follow the separator. If the list is empty, any type can follow the separator.
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
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
see
None