Module: Olyx::Guardrails::Pii::NamedDateValidator

Defined in:
lib/olyx/guardrails/pii/named_date_validator.rb

Overview

Validates English abbreviated or full month dates.

Constant Summary collapse

FORMATS =
['%B %d, %Y', '%B %d %Y', '%b %d, %Y', '%b %d %Y'].freeze

Class Method Summary collapse

Class Method Details

.call(value) ⇒ Object



14
15
16
# File 'lib/olyx/guardrails/pii/named_date_validator.rb', line 14

def call(value)
  FORMATS.any? { |format| valid?(value.delete('.'), format) }
end