Sha256: 928091f61017aebb3624f77e3d8f0047ed19b66f72851f972dcb79a5d3fac093

Contents?: true

Size: 719 Bytes

Versions: 6

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

require_relative "countries_regions_and_cities_by_pete/version"

require 'carmen'
require 'city-state'

module CountriesRegionsAndCitiesByPete
  
 # require 'countries_regions_and_cities_by_peterconsuegra/railtie' if defined?(Rails)
  
  class Error < StandardError; end
  # Your code goes here...
  
  def self.get_all_countries
    return Carmen::Country::all
  end
  
  def self.get_regions(selected_country)
    country = Carmen::Country.coded(selected_country)
    return country.subregions if country
  end
  
  def self.get_cities(selected_region,selected_country)
    CS.cities(selected_region,selected_country)
  end
  
end

require_relative "railtie" if defined?(Rails::Railtie)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
countries_regions_and_cities_by_pete-0.3.5 lib/countries_regions_and_cities_by_pete.rb
countries_regions_and_cities_by_pete-0.3.4 lib/countries_regions_and_cities_by_pete.rb
countries_regions_and_cities_by_pete-0.3.3 lib/countries_regions_and_cities_by_pete.rb
countries_regions_and_cities_by_pete-0.3.2 lib/countries_regions_and_cities_by_pete.rb
countries_regions_and_cities_by_pete-0.3.0 lib/countries_regions_and_cities_by_pete.rb
countries_regions_and_cities_by_pete-0.2.0 lib/countries_regions_and_cities_by_pete.rb