lib/phonelib/phone_analyzer_helper.rb in phonelib-0.9.0 vs lib/phonelib/phone_analyzer_helper.rb in phonelib-0.9.1
- old
+ new
@@ -6,9 +6,10 @@
def decorate_analyze_result(result)
if result.size == 1
result
else
matched_countries = country_or_default_country(nil) & result.keys
+ matched_countries = result.keys.take(1) if matched_countries.size == 0
result = result.keep_if {|k, _v| matched_countries.include?(k) } if matched_countries
Hash[result.take(1)]
end
end