Class: Oasis::App::List

Inherits:
Array
  • Object
show all
Defined in:
lib/oasis/app/list.rb

Instance Method Summary collapse

Instance Method Details

#[](name_or_index) ⇒ Object

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



9
10
11
12
13
14
15
# File 'lib/oasis/app/list.rb', line 9

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

#by_precedenceObject

Go through each plugin, highest priority first (last loaded first).



18
19
20
# File 'lib/oasis/app/list.rb', line 18

def by_precedence
  reverse
end