Class: DataAnon::Strategy::Field::AnonymizeDateTime

  • Object
show all
Defined in:


Anonymizes each field(except year and seconds) within the natural range (e.g. hour between 1-24 and day within the month) based on true/false input for that field. By default, all fields are anonymized.

# anonymizes month and hour fields, leaving the day and minute fields untouched

In addition to customizing which fields you want anonymized, there are some helper methods which allow for quick anonymization

# anonymizes only the month field
anonymize('DateOfBirth').using FieldStrategy::AnonymizeDateTime.only_month
# anonymizes only the day field
anonymize('DateOfBirth').using FieldStrategy::AnonymizeDateTime.only_day
# anonymizes only the hour field
anonymize('DateOfBirth').using FieldStrategy::AnonymizeDateTime.only_hour
# anonymizes only the minute field
anonymize('DateOfBirth').using FieldStrategy::AnonymizeDateTime.only_minute

Constant Summary

Constants inherited from AnonymizeTime


Method Summary

Methods inherited from AnonymizeTime

#anonymize, #initialize, only_day, only_hour, only_minute, only_month

Constructor Details

This class inherits a constructor from DataAnon::Strategy::Field::AnonymizeTime