class Seahorse::Client::PluginList::PluginWrapper
@api private
required.
and defers requiring the plugin until the plugin class is
A utility class that computes the canonical name for a plugin
def self.new(plugin)
def self.new(plugin) if plugin.is_a?(self) plugin else super end end
def eql? other
- Api: - private
Returns:
-
(Boolean)
-
def eql? other canonical_name == other.canonical_name end
def hash
- Api: - private
Returns:
-
(String)
-
def hash canonical_name.hash end
def initialize(plugin)
-
plugin
(String, Symbol, Module, Class
) --
def initialize(plugin) case plugin when Module @canonical_name = plugin.name || plugin.object_id @plugin = plugin when Symbol, String words = plugin.to_s.split('.') @canonical_name = words.pop @gem_name = words.empty? ? nil : words.join('.') @plugin = nil else @canonical_name = plugin.object_id @plugin = plugin end end
def plugin
-
(Class
-)
def plugin @plugin ||= require_plugin end
def require_plugin
-
(Class
-)
def require_plugin require(@gem_name) if @gem_name plugin_class = Kernel @canonical_name.split('::').each do |const_name| plugin_class = plugin_class.const_get(const_name) end plugin_class end