lib/ddplugin/plugin.rb in ddplugin-0.1 vs lib/ddplugin/plugin.rb in ddplugin-1.0.0

- old
+ new

@@ -1,14 +1,10 @@ -# encoding: utf-8 - module DDPlugin - # A module that contains class methods for plugins. It provides functions # for setting identifiers and finding plugins. Plugin classes should extend # this module. module Plugin - # @overload identifiers(*identifiers) # # Sets the identifiers for this class. # # @param [Array<Symbol>] identifiers A list of identifiers to assign to @@ -43,15 +39,15 @@ # @return [void] # # @overload identifier # # @return [Symbol] The first identifier for this class - def identifier(identifier=nil) + def identifier(identifier = nil) if identifier - self.identifiers(identifier) + identifiers(identifier) else - self.identifiers.first + identifiers.first end end # @return [Enumerable<Class>] All classes of this type def all @@ -62,9 +58,7 @@ # # @return [Class] The class with the given identifier def named(identifier) DDPlugin::Registry.instance.find(self, identifier) end - end - end