module NormalizeAttributes::Callbacks::ClassMethods
Public Instance Methods
normalize(*args, &block)
click to toggle source
# File lib/normalize_attributes/callbacks.rb, line 62 def normalize(*args, &block) self.normalize_options ||= {} options = args.extract_options! args.each do |attr_name| attr_name = attr_name.to_sym normalize_options.tap do |o| o[attr_name] ||= [] o[attr_name] << [ [block, options[:with]].flatten.compact, options.except(:with) ] end end end