Class: Crabfarm::Strategies::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/crabfarm/strategies.rb

Instance Method Summary collapse

Constructor Details

#initialize(_klass, _pkg = nil) ⇒ Loader

Returns a new instance of Loader.



5
6
7
8
# File 'lib/crabfarm/strategies.rb', line 5

def initialize(_klass, _pkg=nil)
  @klass = _klass
  @pkg = _pkg
end

Instance Method Details

#loadObject



10
11
12
13
# File 'lib/crabfarm/strategies.rb', line 10

def load
  require @pkg if @pkg
  if @klass.is_a? String then Object.const_get @klass else @klass end
end