Class: Cardio::Mod::Loader::SetLoader

Inherits:
Cardio::Mod::Loader show all
Defined in:
card/lib/cardio/mod/loader/set_loader.rb

Overview

A SetLoader object loads all set modules for a list of mods. The mods are given by a Mod::Dirs object. SetLoader can use three different strategies to load the set modules.

Defined Under Namespace

Classes: Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Cardio::Mod::Loader

load_dir, load_initializers, load_mods, module_class_template, reload_sets

Constructor Details

#initialize(args = {}) ⇒ SetLoader

Returns a new instance of SetLoader.



11
12
13
14
# File 'card/lib/cardio/mod/loader/set_loader.rb', line 11

def initialize args={}
  @patterns = args.delete(:patterns) || Card::Set::Pattern.loadable_codes
  super
end

Instance Attribute Details

#patternsObject

Returns the value of attribute patterns.



9
10
11
# File 'card/lib/cardio/mod/loader/set_loader.rb', line 9

def patterns
  @patterns
end

Instance Method Details

#loadObject



27
28
29
30
31
# File 'card/lib/cardio/mod/loader/set_loader.rb', line 27

def load
  super
  # Card::Set.process_base_modules
  Card::Set.clean_empty_modules
end

#load_strategy_class(load_strategy) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'card/lib/cardio/mod/loader/set_loader.rb', line 16

def load_strategy_class load_strategy
  case load_strategy
  when :tmp_files
    LoadStrategy::SetTmpFiles
  when :binding_magic
    LoadStrategy::SetBindingMagic
  else
    LoadStrategy::Eval
  end
end