Class: Pluggable::Plugins

Inherits:
Array
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pluggable.rb

Class Method Summary collapse

Class Method Details

.from_array_of_instance_and_name_pairs(array) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/pluggable.rb', line 10

def self.from_array_of_instance_and_name_pairs array
  result = new
  array.each do |each_pair| 
    result << each_pair[:instance]
    result.instance_variable_set each_pair[:name], each_pair[:instance]
  end
  result
end