Sha256: 321c8dae8437c4f5fa13171217090f5e495e612575e0973fe0a6f15e6dee7ffa

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

# @api private
# @since 2.2.0
module TableSync::Plugins::AccessMixin
  # @param plugin_name [Symbol, String]
  # @return [void]
  #
  # @see TableSync::Plugins
  #
  # @api public
  # @since 2.2.0
  def plugin(plugin_name)
    TableSync::Plugins.load(plugin_name)
  end
  alias_method :enable, :plugin
  alias_method :load, :plugin

  # @return [Array<String>]
  #
  # @see TableSync::Plugins
  #
  # @api public
  # @since 2.2.0
  def plugins
    TableSync::Plugins.names
  end

  # @return [Hash<String,Class<TableSync::Plugins::Abstract>>]
  #
  # @api private
  # @since 2.2.0
  def loaded_plugins
    TableSync::Plugins.loaded_plugins
  end
  alias_method :enabled_plugins, :loaded_plugins

  # @param plugin_name [String, Symbol]
  # @param plugin_klass [Class<TableSync::Plugins::Abstract>]
  # @return [void]
  #
  # @see TableSync::Plugins
  #
  # @api public
  # @since 2.2.0
  def register_plugin(plugin_name, plugin_klass)
    TableSync::Plugins.register_plugin(plugin_name, plugin_klass)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
table_sync-2.3.0 lib/table_sync/plugins/access_mixin.rb
table_sync-2.2.0 lib/table_sync/plugins/access_mixin.rb