Class: LogCabin::GemCollection
- Inherits:
-
BaseCollection
- Object
- BaseCollection
- LogCabin::GemCollection
- Defined in:
- lib/logcabin/gemcollection.rb
Overview
Define a collection of modules in separate gems
Instance Method Summary collapse
-
#find(name) ⇒ Object
Method for finding modules to load.
-
#initialize(params = {}) ⇒ GemCollection
constructor
A new instance of GemCollection.
Constructor Details
#initialize(params = {}) ⇒ GemCollection
Returns a new instance of GemCollection.
5 6 7 8 |
# File 'lib/logcabin/gemcollection.rb', line 5 def initialize(params = {}) @prefix = params[:prefix] || raise('Gem prefix must be provided') super end |
Instance Method Details
#find(name) ⇒ Object
Method for finding modules to load
12 13 14 |
# File 'lib/logcabin/gemcollection.rb', line 12 def find(name) cache(name) { load_class_from_module("#{@prefix}-#{name}", name) } end |