halogenandtoast/timelord

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

Summary

Maintainability
A
0 mins
Test Coverage
module Timelord
  class CurrentThursdayMatcher < Matcher
    REGEX = /\b(thur|thurs)\b/

    def to_date
      CurrentWeekday.new(date_index, today).to_date
    end

    private

    def date_index
      DAY_NAMES.index("thursday")
    end
  end
end