Class: PublifyPlugins::Keeper

Inherits:
Object
  • Object
show all
Defined in:
lib/publify_plugins.rb

Constant Summary collapse

KINDS =
[:avatar, :textfilter].freeze
@@registered =
{}

Class Method Summary collapse

Class Method Details

.available_plugins(kind = nil) ⇒ Object



33
34
35
36
37
38
# File 'lib/publify_plugins.rb', line 33

def available_plugins(kind = nil)
  return @@registered.inspect unless kind

  check_kind(kind)
  @@registered[kind] || []
end

.register(klass) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/publify_plugins.rb', line 40

def register(klass)
  kind = klass.kind
  check_kind(kind)
  @@registered[kind] ||= []
  @@registered[kind] << klass
  @@registered[kind]
end