Module: InterpretDate

Defined in:
lib/interpret_date.rb,
lib/interpret_date/version.rb

Constant Summary collapse

VERSION =
"1.0.1"

Instance Method Summary collapse

Instance Method Details

#interpret_date(date_input, buffer = 10) ⇒ Object



4
5
6
7
8
# File 'lib/interpret_date.rb', line 4

def interpret_date(date_input, buffer = 10)
  # the number of years previous turn of the century + buffer number of years
  @century_divider = Date.today.year + buffer - current_century
  convert_date(date_input)
end

#interpret_dob_date(date_input) ⇒ Object



10
11
12
13
14
# File 'lib/interpret_date.rb', line 10

def interpret_dob_date(date_input)
  # the number of years since previous turn of the century
  @century_divider = Date.today.year - current_century
  convert_date(date_input)
end