Class: RuGUI::Plugin::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/rugui/plugin/loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(initializer, configurations) ⇒ Loader

Returns a new instance of Loader.



8
9
10
11
12
# File 'lib/rugui/plugin/loader.rb', line 8

def initialize(initializer, configurations)
  self.initializer = initializer
  self.configurations = configurations
  @@located_plugins ||= []
end

Instance Attribute Details

#configurationsObject

Returns the value of attribute configurations.



5
6
7
# File 'lib/rugui/plugin/loader.rb', line 5

def configurations
  @configurations
end

#initializerObject

Returns the value of attribute initializer.



4
5
6
# File 'lib/rugui/plugin/loader.rb', line 4

def initializer
  @initializer
end

Instance Method Details

#load_pluginsObject



14
15
16
17
18
19
# File 'lib/rugui/plugin/loader.rb', line 14

def load_plugins
  plugins.each do |plugin|
    plugin.load unless plugin.loaded?
    register_as_loaded(plugin)
  end
end

#pluginsObject



21
22
23
# File 'lib/rugui/plugin/loader.rb', line 21

def plugins
  @plugins ||= locate_plugins
end