Class: Cardio::Mod::LoadStrategy

Inherits:
Object
  • Object
show all
Defined in:
card/lib/cardio/mod/load_strategy.rb,
card/lib/cardio/mod/load_strategy/eval.rb,
card/lib/cardio/mod/load_strategy/tmp_files.rb,
card/lib/cardio/mod/load_strategy/set_tmp_files.rb,
card/lib/cardio/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 Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mod_dirs, loader) ⇒ LoadStrategy

Returns a new instance of LoadStrategy.



21
22
23
24
25
# File 'card/lib/cardio/mod/load_strategy.rb', line 21

def initialize mod_dirs, loader
  LoadStrategy.current = self.class
  @mod_dirs = mod_dirs
  @loader = loader
end

Class Attribute Details

.currentObject

Returns the value of attribute current.



6
7
8
# File 'card/lib/cardio/mod/load_strategy.rb', line 6

def current
  @current
end

.tmp_filesObject

Returns the value of attribute tmp_files.



6
7
8
# File 'card/lib/cardio/mod/load_strategy.rb', line 6

def tmp_files
  @tmp_files
end

Class Method Details

.klass(symbol) ⇒ Object



8
9
10
11
12
13
14
# File 'card/lib/cardio/mod/load_strategy.rb', line 8

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

.tmp_files?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'card/lib/cardio/mod/load_strategy.rb', line 16

def tmp_files?
  Cardio.config.load_strategy == :tmp_files
end

Instance Method Details

#clean_comments?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'card/lib/cardio/mod/load_strategy.rb', line 27

def clean_comments?
  false
end