Module: ObscurifyAttribute::Validations::ClassMethods
- Defined in:
- lib/obscurify_attribute/validations.rb
Instance Attribute Summary collapse
-
#sensitive_attrs ⇒ Object
readonly
Returns the value of attribute sensitive_attrs.
Instance Method Summary collapse
Instance Attribute Details
#sensitive_attrs ⇒ Object (readonly)
Returns the value of attribute sensitive_attrs.
10 11 12 |
# File 'lib/obscurify_attribute/validations.rb', line 10 def sensitive_attrs @sensitive_attrs end |
Instance Method Details
#obscurify(*args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/obscurify_attribute/validations.rb', line 12 def obscurify(*args) = args. args.reject!(&:blank?) .symbolize_keys! .assert_valid_keys(:message) to_name = args.pop raise(ArgumentError, "Should specify a second (target) attribute name") if args.empty? args.inject(sensitive_attrs) do |h, attr| h[attr] = {:to => to_name}.merge() h end end |