Method: Pipl::DOB#age
- Defined in:
- lib/pipl/fields.rb
#age ⇒ Object
489 490 491 492 493 494 495 496 497 |
# File 'lib/pipl/fields.rb', line 489 def age unless @date_range.nil? dob = @date_range.middle today = Date.today diff = today.year - dob.year diff = diff - 1 if dob.month > today.month || (dob.month >= today.month && dob.day > today.day) diff end end |