Sha256: 13e04625396948057b9f883f079a8e7e5f4b3ececdd6c591371cfb734fc41910

Contents?: true

Size: 356 Bytes

Versions: 1

Compression:

Stored size: 356 Bytes

Contents

module CitiesInTurkey
  class City
    def initialize(name, alpha_2_code, towns)
      @name = name
      @alpha_2_code = alpha_2_code
      @towns = towns
    end

    def towns
      @towns.map { |town| Town.new(town['name'], town['districts']) }.to_a
    end

    def name
      @name
    end

    def alpha_2_code
      @alpha_2_code
    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/city.rb