Class: Engines::Plugin::List

Inherits:
Array
  • Object
show all
Defined in:
vendor/plugins/engines/lib/engines/plugin/list.rb

Instance Method Summary

Methods inherited from Array

#to_ber, #to_ber_appsequence, #to_ber_contextspecific, #to_ber_sequence, #to_ber_set, #to_csv

Methods included from Diffable

#diff, #patch, #replacenextlarger, #reverse_hash

Instance Method Details

- (Object) [](name_or_index)

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.



15
16
17
18
19
20
21
# File 'vendor/plugins/engines/lib/engines/plugin/list.rb', line 15

def [](name_or_index)
  if name_or_index.is_a?(Fixnum)
    super
  else
    self.find { |plugin| plugin.name.to_s == name_or_index.to_s }
  end
end

- (Object) by_precedence

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



25
26
27
# File 'vendor/plugins/engines/lib/engines/plugin/list.rb', line 25

def by_precedence
  reverse
end