Class: Pluginator::Autodetect

Inherits:
Group
  • Object
show all
Includes:
NameConverter
Defined in:
lib/pluginator/autodetect.rb

Overview

Add autodetection capabilities to Group

See Also:

Direct Known Subclasses

ExtendableAutodetect

Instance Attribute Summary

Attributes inherited from Group

#group

Instance Method Summary collapse

Methods inherited from Group

#[], #register_plugin, #types

Constructor Details

#initialize(group, options = {}) ⇒ Autodetect

Automatically load plugins for given group (and type)

Parameters:

  • group (String)

    name of the plugins group

  • type (Hash)

    a customizable set of options



33
34
35
36
# File 'lib/pluginator/autodetect.rb', line 33

def initialize(group, options = {})
  super(group)
  setup_autodetect(options[:type])
end

Instance Method Details

#typeObject



38
39
40
# File 'lib/pluginator/autodetect.rb', line 38

def type
  @plugins[@force_type] unless @force_type.nil?
end