Class: Card::Mod::LoadStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/card/mod/load_strategy.rb,
lib/card/mod/load_strategy/eval.rb,
lib/card/mod/load_strategy/tmp_files.rb,
lib/card/mod/load_strategy/set_tmp_files.rb,
lib/card/mod/load_strategy/pattern_tmp_files.rb

Overview

Shared code for the three different load strategies: Eval, TmpFiles and BindingMagic

Direct Known Subclasses

BindingMagic, Eval, TmpFiles

Defined Under Namespace

Classes: Eval, PatternTmpFiles, SetTmpFiles, TmpFiles

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mod_dirs, loader) ⇒ LoadStrategy

Returns a new instance of LoadStrategy.



20
21
22
23
# File 'lib/card/mod/load_strategy.rb', line 20

def initialize mod_dirs, loader
  @mod_dirs = mod_dirs
  @loader = loader
end

Class Method Details

.klass(symbol) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/card/mod/load_strategy.rb', line 12

def self.klass symbol
  case symbol
    when :tmp_files     then TmpFiles
    when :binding_magic then BindingMagic
    else                     Eval
  end
end