Method: Pipl::DOB.from_birth_date

Defined in:
lib/pipl/fields.rb

.from_birth_date(birth_date) ⇒ Object

Raises:

  • (ArgumentError)


462
463
464
465
# File 'lib/pipl/fields.rb', line 462

def self.from_birth_date(birth_date)
  raise ArgumentError.new('birth_date can\'t be in the future') unless birth_date <= Date.today
  self.new({date_range: DateRange.new(birth_date, birth_date)})
end