lib/nanoc/base/plugin_registry.rb
# Registers the given class as a plugin.
#
# @param [Class] superclass The superclass of the plugin. For example:
#   {Nanoc::Filter}, {Nanoc::Extra::VCS}.
#
# @param [Class, String] class_or_name The class to register. This can be
#   a string, in which case it will be automatically converted to a proper
#   class at lookup. For example: `Nanoc::Filters::ERB`,
#   `"Nanoc::Filters::Haml"`.
#
# @param [Symbol] identifiers One or more symbols identifying the class.
#   For example: `:haml`, :`erb`.
#
# @return [void]
Registers the given class as a plugin.
Registers the given class as a plugin .
def register(superclass, class_or_name, *identifiers)
      @identifiers_to_classes[superclass] ||= {}
      @classes_to_identifiers[superclass] ||= {}
      identifiers.each do |identifier|
        @identifiers_to_classes[superclass][identifier.to_sym] = class_or_name
        (@classes_to_identifiers[superclass][name_for_class(class_or_name)] ||= []) << identifier.to_sym
      end
    end
def register ( superclass , class_or_name , * identifiers ) @identifiers_to_classes [ superclass ] ||= { } @classes_to_identifiers [ superclass ] ||= { } identifiers . each do | identifier | @identifiers_to_classes [ superclass ] [ identifier . to_sym ] = class_or_name ( @classes_to_identifiers [ superclass ] [ name_for_class ( class_or_name ) ] ||= [ ] ) << identifier . to_sym end end
Registers the given class as a plugin.
Registers the given class as a plugin .
None
void
superclass
class_or_name
identifiers
identifiers One or more symbols identifying the class. For example: `:haml`, :`erb`.
identifiers One or more symbols identifying the class . For example : ` : haml ` : ` erb ` .