Sha256: c575134342f0c5522a586fd40e26e3cdf8a5bbea74b6bd6204fae96634aabcf6

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

require "cities_in_turkey/version"
require "cities_in_turkey/city"
require "cities_in_turkey/town"
require "cities_in_turkey/district"
require "cities_in_turkey/quarter"

require "yaml"

module CitiesInTurkey
  autoload :City, "cities_in_turkey/city"
  autoload :Town, "cities_in_turkey/town"
  autoload :District, "cities_in_turkey/district"
  autoload :Quarter, "cities_in_turkey/quarter"

  class Error < StandardError; end

  class << self
    def cities
      @cities ||= YAML.load_file(File.join(File.dirname(__FILE__), "cities_in_turkey/data/cities.yml")).map do |city|
        City.new(city['name'], city['alpha_2_code'], city['towns'])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cities-in-turkey-0.2.0 lib/cities_in_turkey.rb