halogenandtoast/timelord

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

Summary

Maintainability
A
0 mins
Test Coverage
module Timelord
  class LongMonthYearMatcher < FutureMatcher
    REGEX = /\b(#{LONG_MATCHER})\s+(\d{4})\b/i

    private

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