Module: Ribbon::Plugins::ComponentMixin::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#plugin_loader(&block) ⇒ Object

Get or define the plugin loader.

This block will be used to load a plugin given the value passed to the plugin instance method. It's the responsibility of this block to translate the inputted value into either a Class that extends Plugin or a Proc.

If for a particular value you wish to not perform any translation, return falsey.


21
22
23
24
25
26
27
# File 'lib/ribbon/plugins/component_mixin.rb', line 21

def plugin_loader(&block)
  if block_given?
    @_plugin_loader = block
  else
    @_plugin_loader
  end
end