365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
# File 'lib/attribute-filters/dsl_sets.rb', line 365
def filter_attribute(*args)
AFHelpers.check_wanted_methods(self)
case args.size
when 0
attributes_to_sets
when 1
first_arg = args.first
if first_arg.is_a?(Hash)
first_arg.each_pair { |k, v| filter_attribute(k, v) }
nil
else
r = __attributes_to_sets_map[first_arg.to_s]
r.frozen? ? r : r.deep_dup
end
else
first_arg = args.shift
if first_arg.is_a?(Hash)
first_arg.each_pair do |k, v|
filter_attribute(k, v, args)
end
else
first_arg = first_arg.to_s
args.flatten.compact.each do |set_name|
if set_name.is_a?(Hash) set_name.each_pair do |set_name_b, a_defs|
af_attribute_set(set_name_b, first_arg => a_defs)
end
else
af_attribute_set(set_name, first_arg)
end
end
end
nil
end
end
|