Module: Ribbon::Plugins::ComponentMixin

Defined in:
lib/ribbon/plugins/component_mixin.rb

Overview

Intended to be mixed into any class utilizing the plugins functionality.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


6
7
8
# File 'lib/ribbon/plugins/component_mixin.rb', line 6

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#plugin(*args, &block) ⇒ Object

Add a plugin.


42
43
44
# File 'lib/ribbon/plugins/component_mixin.rb', line 42

def plugin(*args, &block)
  plugins.add(*args, &block)
end

#pluginsObject

Reference to the Plugins instance for the component.


36
37
38
# File 'lib/ribbon/plugins/component_mixin.rb', line 36

def plugins
  @plugins ||= Plugins.new(self, &self.class.plugin_loader)
end