Module: DayOffs::Sources::Utils

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

Class Method Summary collapse

Class Method Details

.valid_country_alpha2_code?(country_code) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/day_offs/sources/utils.rb', line 5

def valid_country_alpha2_code?(country_code)
  !!(country_code =~ /^[A-Z]{2}$/)
end

.valid_year?(year) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/day_offs/sources/utils.rb', line 9

def valid_year?(year)
  !!(year.to_s =~ /^[0-9]{4}$/)
end