halogenandtoast/timelord

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

Summary

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

    private

    def parse_date
      Date.civil(ints[2], month_by_index(strings[1]))
    end
  end
end