Class: AttributesSanitizer::Overrider
- Inherits:
-
Object
- Object
- AttributesSanitizer::Overrider
- Defined in:
- lib/attributes_sanitizer/overrider.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Overrider
constructor
A new instance of Overrider.
- #override_getters_and_setters ⇒ Object
Constructor Details
#initialize(klass) ⇒ Overrider
Returns a new instance of Overrider.
6 7 8 |
# File 'lib/attributes_sanitizer/overrider.rb', line 6 def initialize(klass) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
4 5 6 |
# File 'lib/attributes_sanitizer/overrider.rb', line 4 def klass @klass end |
Instance Method Details
#override_getters_and_setters ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/attributes_sanitizer/overrider.rb', line 10 def override_getters_and_setters return if klass.attributes_sanitize_map.blank? attributes_to_override.each do |attribute| override_getter(attribute) override_setter(attribute) end end |