Module: DayOffs::Sources::Validator

Defined in:
lib/day_offs/sources/validator.rb

Class Method Summary collapse

Class Method Details

.validate_country(country) ⇒ Object



5
6
7
8
9
# File 'lib/day_offs/sources/validator.rb', line 5

def validate_country(country)
  unless DayOffs::Sources::Utils.valid_country_alpha2_code?(country)
    raise DayOffs::Sources::Errors::IncorrectAlpha2CountryError
  end
end

.validate_year(year) ⇒ Object



11
12
13
14
15
# File 'lib/day_offs/sources/validator.rb', line 11

def validate_year(year)
  unless DayOffs::Sources::Utils.valid_year?(year)
    raise DayOffs::Sources::Errors::IncorrectYearError
  end
end