~singpolyma/sgx-jmp

35aa3f7f85a8a06867e69659e554848b19d3e9d4 — Stephen Paul Weber 2 years ago f316c9b
Bandwidth is very picky about city and state/province names

So transform reasonable things into what we know Bandwidth expects.
1 files changed, 12 insertions(+), 2 deletions(-)

M lib/tel_selections.rb
M lib/tel_selections.rb => lib/tel_selections.rb +12 -2
@@ 188,9 188,19 @@ class TelSelections

			class CityState
				Q.register(/\A([^,]+)\s*,\s*([A-Z]{2})\Z/, &method(:new))

				CITY_MAP = {
					"kitchener" => "Kitchener-Waterloo",
					"waterloo" => "Kitchener-Waterloo"
				}.freeze

				STATE_MAP = {
					"QC" => "PQ"
				}.freeze

				def initialize(city, state)
					@city = city
					@state = state
					@city = CITY_MAP.fetch(city.downcase, city)
					@state = STATE_MAP.fetch(state, state)
				end

				def iris_query