Class: LogCabin::GemCollection

Inherits:
BaseCollection show all
Defined in:
lib/logcabin/gemcollection.rb

Overview

Define a collection of modules in separate gems

Instance Method Summary collapse

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