Class: Crabfarm::Strategies::Loader
- Inherits:
-
Object
- Object
- Crabfarm::Strategies::Loader
- Defined in:
- lib/crabfarm/strategies.rb
Instance Method Summary collapse
-
#initialize(_klass, _pkg = nil) ⇒ Loader
constructor
A new instance of Loader.
- #load ⇒ Object
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
#load ⇒ Object
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 |