Class: TableSync::Plugins::Registry Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/table_sync/plugins/registry.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0

Instance Method Summary collapse

Constructor Details

#initializevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



12
13
14
15
# File 'lib/table_sync/plugins/registry.rb', line 12

def initialize
  @plugin_set = {}
  @access_lock = Mutex.new
end

Instance Method Details

#[](plugin_name) ⇒ TableSync::Plugins::Abstract

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • plugin_name (Symbol, String)

Returns:

Since:

  • 2.2.0



22
23
24
# File 'lib/table_sync/plugins/registry.rb', line 22

def [](plugin_name)
  thread_safe { fetch(plugin_name) }
end

#each(&block) ⇒ Enumerable

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • block (Block)

Returns:

  • (Enumerable)

Since:

  • 2.2.0



58
59
60
# File 'lib/table_sync/plugins/registry.rb', line 58

def each(&block)
  thread_safe { iterate(&block) }
end

#loadedHash<String,Class<TableSync::Plugins::Abstract>>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 2.2.0



49
50
51
# File 'lib/table_sync/plugins/registry.rb', line 49

def loaded
  thread_safe { loaded_plugins }
end

#namesArray<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Array<String>)

Since:

  • 2.2.0



41
42
43
# File 'lib/table_sync/plugins/registry.rb', line 41

def names
  thread_safe { plugin_names }
end

#register(plugin_name, plugin_module) ⇒ void Also known as: []=

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

Since:

  • 2.2.0



32
33
34
# File 'lib/table_sync/plugins/registry.rb', line 32

def register(plugin_name, plugin_module)
  thread_safe { apply(plugin_name, plugin_module) }
end