Class: Cardio::Mod::LoadStrategy
- Inherits:
-
Object
- Object
- Cardio::Mod::LoadStrategy
- Defined in:
- lib/cardio/mod/load_strategy.rb,
lib/cardio/mod/load_strategy/eval.rb,
lib/cardio/mod/load_strategy/tmp_files.rb,
lib/cardio/mod/load_strategy/set_tmp_files.rb,
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
Defined Under Namespace
Classes: Eval, PatternTmpFiles, SetTmpFiles, TmpFiles
Class Attribute Summary collapse
-
.current ⇒ Object
Returns the value of attribute current.
-
.tmp_files ⇒ Object
Returns the value of attribute tmp_files.
Instance Attribute Summary collapse
-
#loader ⇒ Object
readonly
Returns the value of attribute loader.
Class Method Summary collapse
Instance Method Summary collapse
- #clean_comments? ⇒ Boolean
-
#initialize(loader) ⇒ LoadStrategy
constructor
A new instance of LoadStrategy.
Constructor Details
#initialize(loader) ⇒ LoadStrategy
Returns a new instance of LoadStrategy.
30 31 32 33 |
# File 'lib/cardio/mod/load_strategy.rb', line 30 def initialize loader LoadStrategy.current = self.class @loader = loader end |
Class Attribute Details
.current ⇒ Object
Returns the value of attribute current.
6 7 8 |
# File 'lib/cardio/mod/load_strategy.rb', line 6 def current @current end |
.tmp_files ⇒ Object
Returns the value of attribute tmp_files.
6 7 8 |
# File 'lib/cardio/mod/load_strategy.rb', line 6 def tmp_files @tmp_files end |
Instance Attribute Details
#loader ⇒ Object (readonly)
Returns the value of attribute loader.
27 28 29 |
# File 'lib/cardio/mod/load_strategy.rb', line 27 def loader @loader end |
Class Method Details
.class_for_set(strategy) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/cardio/mod/load_strategy.rb', line 8 def class_for_set strategy case strategy when :tmp_files then SetTmpFiles when :binding_magic then SetBindingMagic else Eval end end |
.class_for_set_pattern(strategy) ⇒ Object
16 17 18 19 20 |
# File 'lib/cardio/mod/load_strategy.rb', line 16 def class_for_set_pattern strategy return PatternTmpFiles if strategy == :tmp_files Eval end |
.tmp_files? ⇒ Boolean
22 23 24 |
# File 'lib/cardio/mod/load_strategy.rb', line 22 def tmp_files? Cardio.config.load_strategy == :tmp_files end |
Instance Method Details
#clean_comments? ⇒ Boolean
35 36 37 |
# File 'lib/cardio/mod/load_strategy.rb', line 35 def clean_comments? false end |