Files
ubicloud/lib/location_name_converter.rb
Burak Velioglu 0ed1fac80b Add functions to handle conversion between internal and display location names
Add functions as a part of a module to convert internal location name to display
location name, or vice versa. For the mapping, providers.yml config
file can be checked.
2024-04-24 01:46:35 -07:00

12 lines
300 B
Ruby

# frozen_string_literal: true
module LocationNameConverter
def self.to_internal_name(display_name)
Option::LOCATIONS.find { _1.display_name == display_name }&.name
end
def self.to_display_name(internal_name)
Option::LOCATIONS.find { _1.name == internal_name }&.display_name
end
end