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)

Returns the given plugin if it is already a PluginWrapper.
def self.new(plugin)
  if plugin.is_a?(self)
    plugin
  else
    super
  end
end

def eql? other

Other tags:
    Api: - private

Returns:
  • (Boolean) -
def eql? other
  canonical_name == other.canonical_name
end

def hash

Other tags:
    Api: - private

Returns:
  • (String) -
def hash
  canonical_name.hash
end

def initialize(plugin)

Parameters:
  • plugin (String, Symbol, Module, Class) --
def initialize(plugin)
  case plugin
  when Module
    @canonical_name = plugin.name || plugin.object_id
    @plugin = plugin
  when Symbol, String
    @canonical_name, @gem_name = plugin.to_s.split('.').reverse
    @plugin = nil
  else
    @canonical_name = plugin.object_id
    @plugin = plugin
  end
end

def plugin

Returns:
  • (Class) -
def plugin
  @plugin ||= require_plugin
end

def require_plugin

Returns:
  • (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