Module: Card::Set::All::TrackedAttributes

Extended by:
Card::Set
Defined in:
tmpsets/set/mod002-core/all/tracked_attributes.rb

Constant Summary

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Instance Method Summary collapse

Methods included from Card::Set

reset_modules

Methods included from I18nScope

#mod_name, #scope

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set

Methods included from Helpers

#method_missing, #num_set_parts, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscore

Methods included from Card::Set::AdvancedApi

#attachment, #ensure_set, #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 Basket

#abstract_basket, #add_to_basket, #basket, #unshift_basket

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Instance Method Details

#assign_attributes(args = {}) ⇒ Object

~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/tracked_attributes.rb ~~



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'tmpsets/set/mod002-core/all/tracked_attributes.rb', line 4

def assign_attributes args={}
  if args
    args = args.stringify_keys
    @set_specific = {}
    Card.set_specific_attributes.each do |key|
      @set_specific[key] = args.delete(key) if args[key]
    end

    new_type_id = extract_type_id! args unless args.delete("skip_type_lookup")
    subcard_args = extract_subcard_args! args
    args["type_id"] = new_type_id if new_type_id
    reset_patterns
  end
  params = ActionController::Parameters.new(args)
  params.permit!
  super params
  return unless args && subcard_args.present?
  # name= must come before process subcards
  subcards.add subcard_args
end

#assign_set_specific_attributesObject



25
26
27
28
29
30
# File 'tmpsets/set/mod002-core/all/tracked_attributes.rb', line 25

def assign_set_specific_attributes
  return unless @set_specific.present?
  @set_specific.each_pair do |name, value|
    send "#{name}=", value
  end
end