Sha256: 5855f58df13d4258ffd078aa8a7a7d85fb80b5fae354216de2fa0e2f08820dbc

Contents?: true

Size: 636 Bytes

Versions: 8

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

module Anony
  # This exception is thrown when validating the anonymisation strategies for all fields.
  # If some are missing, they will be included in the message.
  #
  # @example 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]
  class FieldException < StandardError
    def initialize(fields)
      fields = Array(fields)
      super("Invalid anonymisation strategy for field(s) #{fields}")
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
anony-1.6.0 lib/anony/field_exception.rb
anony-1.5.0 lib/anony/field_exception.rb
anony-1.4.0 lib/anony/field_exception.rb
anony-1.2.0 lib/anony/field_exception.rb
anony-1.1.0 lib/anony/field_exception.rb
anony-1.0.2 lib/anony/field_exception.rb
anony-1.0.1 lib/anony/field_exception.rb
anony-1.0.0 lib/anony/field_exception.rb