Class: VehicleCodingPh::Checker
- Inherits:
-
Object
- Object
- VehicleCodingPh::Checker
- Defined in:
- lib/vehicle_coding_ph/checker.rb
Class Method Summary collapse
Class Method Details
.call(plate_no, date = Date.today) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/vehicle_coding_ph/checker.rb', line 4 def self.call(plate_no, date = Date.today) return true if weekend?(date) last_digit = plate_no[-1] day_today = Date::DAYNAMES[date.cwday] mapping = VehicleCodingPh::PLATE_TO_DAY_MAPPING. select { |day, digits| day == day_today } !mapping[day_today].include?(last_digit) end |