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

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-card/mod001-core/all/initialize.rb

Overview

Set: All cards (Initialize)

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

JUNK_INIT_ARGS =
%i[missing skip_virtual id].freeze

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Card::Set

reset

Methods included from I18nScope

#mod_name, #scope

Methods included from Registrar

#extended, #finalize_load, #process_base_modules, #register_set

Methods included from Helpers

#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name

Methods included from Card::Set::AdvancedApi

#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method

Methods included from Format

#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



7
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/core/set/all/initialize.rb"; end

Instance Method Details

#handle_set_modules(args) ⇒ Object



51
52
53
54
55
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 51

def handle_set_modules args
  skip_modules = args.delete :skip_modules
  yield
  include_set_modules unless skip_modules
end

#handle_type(args) ⇒ Object



57
58
59
60
61
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 57

def handle_type args
  @supercard = args.delete :supercard
  yield
  ensure_type_id args[:type_lookup]
end

#include_set_module(m) ⇒ Object



78
79
80
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 78

def include_set_module m
  singleton_class.send :include, m
end

#include_set_modulesObject



67
68
69
70
71
72
73
74
75
76
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 67

def include_set_modules
  return self if @set_mods_loaded

  set_modules.each do |m|
    include_set_module m
  end
  assign_set_specific_attributes
  @uncacheable = @set_mods_loaded = true
  self
end

#initial_name(name) ⇒ Object



63
64
65
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 63

def initial_name name
  name.is_a?(String) ? name : Card::Name[name].to_s
end

#initialize(args = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 41

def initialize args={}
  args[:name] = initial_name args[:name]

  handle_set_modules args do
    handle_type args do
      super args # ActiveRecord #initialize
    end
  end
end

#set_mods_loaded?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 82

def set_mods_loaded?
  @set_mods_loaded == true
end

#uncacheable?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'platypus/tmp/set/gem-card/mod001-core/all/initialize.rb', line 86

def uncacheable?
  @uncacheable == true
end