Class: Obfuscator::Generic
- Inherits:
-
Object
- Object
- Obfuscator::Generic
- Defined in:
- lib/obfuscator/generic.rb
Defined Under Namespace
Classes: UnkownObfuscationTypeError
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#model ⇒ Object
Returns the value of attribute model.
Instance Method Summary collapse
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
5 6 7 |
# File 'lib/obfuscator/generic.rb', line 5 def columns @columns end |
#model ⇒ Object
Returns the value of attribute model.
5 6 7 |
# File 'lib/obfuscator/generic.rb', line 5 def model @model end |
Instance Method Details
#scrub!(model_name = "User", columns = []) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/obfuscator/generic.rb', line 7 def scrub!(model_name = "User", columns = []) @model = model_name.singularize.constantize if columns.is_a?(Hash) store_types_from_column_values(columns) @columns = columns.keys else @columns = columns end return unless @columns.any? and @columns.map!(&:to_s) scrub_all_records! end |