Module: InterpretDate

Included in:
DateType
Defined in:
lib/interpret_date.rb,
lib/interpret_date/version.rb,
lib/interpret_date/date_type.rb

Defined Under Namespace

Classes: DateType

Constant Summary collapse

VERSION =
"1.3.0"

Instance Method Summary collapse

Instance Method Details

#interpret_date(date_input, buffer = 10) ⇒ Object



6
7
8
9
10
# File 'lib/interpret_date.rb', line 6

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



12
13
14
15
16
# File 'lib/interpret_date.rb', line 12

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