Module: CountriesPriorities

Included in:
GetCountryByPhone
Defined in:
lib/ptc/utils/countries_priorities.rb

Instance Method Summary collapse

Instance Method Details

#cpsObject



7
8
9
10
11
12
# File 'lib/ptc/utils/countries_priorities.rb', line 7

def cps
  @_dict ||= begin
               ppp = File.expand_path '../dicts/countries_priorities.yml', File.dirname(__FILE__)
               YAML.load_file(ppp)['countries_priorities']
             end
end

#top_priority_country_by_country_code(country_code) ⇒ Object



2
3
4
5
# File 'lib/ptc/utils/countries_priorities.rb', line 2

def top_priority_country_by_country_code(country_code)
  cp = cps[country_code.to_i]
  cp&.first
end