Class: Slugforge::SluginManager
- Inherits:
-
Object
- Object
- Slugforge::SluginManager
- Defined in:
- lib/slugforge/slugins.rb
Defined Under Namespace
Constant Summary collapse
- PREFIX =
/^slugforge-/
Instance Method Summary collapse
- #activate_slugins(config) ⇒ Object
-
#initialize ⇒ SluginManager
constructor
A new instance of SluginManager.
-
#load_slugins ⇒ Object
Require all enabled slugins, disabled slugins are skipped.
-
#slugins ⇒ Hash
A hash with all slugin names (minus the prefix) as keys and slugin objects as values.
Constructor Details
#initialize ⇒ SluginManager
Returns a new instance of SluginManager.
83 84 85 86 |
# File 'lib/slugforge/slugins.rb', line 83 def initialize @slugins = [] locate_slugins end |
Instance Method Details
#activate_slugins(config) ⇒ Object
103 104 105 |
# File 'lib/slugforge/slugins.rb', line 103 def activate_slugins(config) @slugins.each { |s| s.activate!(config) if s.enabled? } end |
#load_slugins ⇒ Object
Require all enabled slugins, disabled slugins are skipped.
99 100 101 |
# File 'lib/slugforge/slugins.rb', line 99 def load_slugins @slugins.each(&:load!) end |