lib/world_flags/util/config.rb in world-flags-0.4.2 vs lib/world_flags/util/config.rb in world-flags-0.4.3

- old
+ new

@@ -1,18 +1,33 @@ module WorldFlags module Util module Config attr_accessor :auto_select, :raise_error attr_accessor :default_code, :default_locale + attr_writer :locale_source_priority + def locale_source_priority + @locale_source_priority ||= default_locale_source_priority + end + + def default_locale_source_priority + supported_locale_source_priorities + end + + def supported_locale_source_priorities + [:param, :domain, :browser, :ip, :default] + end + def reset! raise_error_off! auto_select_off! self.countries = nil + self.hashied_countries = nil self.countries_map = nil self.languages_map = nil + self.hashied_languages = nil self.languages = nil end def default_code_used WorldFlags.default_code || :us \ No newline at end of file