Module: Card::Set::All::Initialize

Extended by:
Card::Set
Defined in:
tmpsets/set/mod001-01_core/all/initialize.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

JUNK_INIT_ARGS =

~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/initialize.rb ~~~~~~~~~~~

%w{ missing skip_virtual id }

Instance Method Summary collapse

Methods included from Card::Set

abstract_set?, all_set?, clean_empty_module_from_hash, clean_empty_modules, define_on_format, each_format, ensure_set, extended, format, include_set, include_set_formats, process_base_module_list, process_base_modules, register_set, register_set_format, shortname, stage_method, view, write_tmp_file

Methods included from Trait

#card_accessor, #card_reader, #card_writer

Methods included from Event

#define_event, #event

Instance Method Details

#include_set_modulesObject



31
32
33
34
35
36
37
38
39
40
# File 'tmpsets/set/mod001-01_core/all/initialize.rb', line 31

def include_set_modules
  unless @set_mods_loaded
    set_modules.each do |m|
      singleton_class.send :include, m
    end
    assign_set_specific_attributes
    @set_mods_loaded = true
  end
  self
end

#initialize(args = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'tmpsets/set/mod001-01_core/all/initialize.rb', line 16

def initialize args = {}
  args['name'] = args['name'].to_s
  args['db_content'] = args.delete('content') if args['content']
  @supercard = args.delete 'supercard' # must come before name =
  skip_modules = args.delete 'skip_modules'
  skip_type_lookup = args['skip_type_lookup']

  super args # ActiveRecord #initialize
  if !type_id && !skip_type_lookup
    self.type_id = get_type_id_from_structure
  end
  include_set_modules unless skip_modules
  self
end