Exception: Anony::FieldException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/anony/field_exception.rb

Overview

This exception is thrown when validating the anonymisation strategies for all fields. If some are missing, they will be included in the message.

Examples:

Missing the first_name field

class Employee
  anonymise { fields { ignore :last_name } }
end

Employee.first.valid_anonymisation?
=> FieldException, Invalid anonymisation strategy for field(s) [:first_name]

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ FieldException

Returns a new instance of FieldException.



15
16
17
18
# File 'lib/anony/field_exception.rb', line 15

def initialize(fields)
  fields = Array(fields)
  super("Invalid anonymisation strategy for field(s) #{fields}")
end