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 =
%w{ missing skip_virtual id }
Instance Method Summary collapse
Methods included from Card::Set
abstract_set?, all_set?, card_accessor, card_reader, card_writer, clean_empty_module_from_hash, clean_empty_modules, define_active_job, define_event_method, define_event_perform_later_method, define_on_format, ensure_set, event, extended, format, process_base_module_list, process_base_modules, register_set, register_set_format, shortname, view, write_tmp_file
Instance Method Details
#include_set_modules ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'tmpsets/set/mod001-01_core/all/initialize.rb', line 43 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
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'tmpsets/set/mod001-01_core/all/initialize.rb', line 15 def initialize args={} args['name'] = args['name' ].to_s args['type_id'] = args['type_id'].to_i args.delete('type_id') if args['type_id'] == 0 # can come in as 0, '', or nil @type_args = { :type => args.delete('type' ), :type_code => args.delete('type_code'), :type_id => args[ 'type_id' ] } args['db_content'] = args.delete('content') if args['content'] #FIXME -- too much of the above is duplicated by assign_attributes (tracked_attributes.rb) @supercard = args.delete 'supercard' # must come before name = skip_modules = args.delete 'skip_modules' super args # ActiveRecord #initialize if tid = get_type_id( @type_args ) self.type_id = tid end include_set_modules unless skip_modules self end |