Class Engines::Plugin::List
In: lib/engines/plugin/list.rb
Parent: Array

Methods

[]   by_precedence  

Public Instance methods

Finds plugins with the set with the given name (accepts Strings or Symbols), or index. So, Engines.plugins[0] returns the first-loaded Plugin, and Engines.plugins[:engines] returns the Plugin instance for the engines plugin itself.

[Source]

    # File lib/engines/plugin/list.rb, line 15
15:       def [](name_or_index)
16:         if name_or_index.is_a?(Fixnum)
17:           super
18:         else
19:           self.find { |plugin| plugin.name.to_s == name_or_index.to_s }
20:         end
21:       end

Go through each plugin, highest priority first (last loaded first). Effectively, this is like Engines.plugins.reverse

[Source]

    # File lib/engines/plugin/list.rb, line 25
25:       def by_precedence
26:         reverse
27:       end

[Validate]