halogenandtoast/timelord

View on GitHub
lib/timelord/matchers/day_short_month_matcher.rb

Summary

Maintainability
A
15 mins
Test Coverage
module Timelord
  class DayShortMonthMatcher < FutureMatcher
    REGEX = /\b(\d{1,2})\s+(#{SHORT_MATCHER})\b/i

    private

    def parse_date
      Date.civil(today.year, SHORT_MONTHS.index(strings[2].downcase) + 1, ints[1])
    end
  end
end