Sha256: 6870277c774f85bad9528d70b8c3c8715b7defeefd003252c301da37efbb03cd

Contents?: true

Size: 784 Bytes

Versions: 35

Compression:

Stored size: 784 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/feeds"

module Renalware
  module Feeds
    module Files
      module Practices
        class CountryMap
          UK_COUNTRIES = [
            "ENGLAND",
            "WALES",
            "SCOTLAND",
            "NORTHERN IRELAND"
          ].freeze

          class Country
            include Virtus.model
            attribute :region
            attribute :country
          end

          def map(country)
            return if country.blank?
            if UK_COUNTRIES.include?(country.upcase.strip)
              Country.new(country: "United Kingdom", region: country.strip.titleize)
            else
              Country.new(country: country)
            end
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.46 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.45 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.44 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.43 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.42 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.41 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.40 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.39 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.38 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.37 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.36 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.35 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.34 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.33 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.32 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.31 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.30 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.28 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.27 app/models/renalware/feeds/files/practices/country_map.rb
renalware-core-2.0.26 app/models/renalware/feeds/files/practices/country_map.rb