Module: CleanRoom::AirLock::Model::ClassMethods
- Defined in:
- lib/clean_room/air_lock.rb
Instance Attribute Summary collapse
-
#sanitizable_attributes ⇒ Object
Returns the value of attribute sanitizable_attributes.
Instance Method Summary collapse
Instance Attribute Details
#sanitizable_attributes ⇒ Object
Returns the value of attribute sanitizable_attributes.
50 51 52 |
# File 'lib/clean_room/air_lock.rb', line 50 def sanitizable_attributes @sanitizable_attributes end |
Instance Method Details
#sanitize_attribute(name, rules = {}) ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/clean_room/air_lock.rb', line 52 def sanitize_attribute(name, rules = {}) name = name.to_sym if instance_methods.include?(name) && instance_methods.include?("#{name}=".to_sym) sanitizable_attributes[name] = rules else raise Exceptions::InvalidAttribute.new("#{self.class} does not respond to '#{name}(=)'") end end |