class DataAnon::Strategy::Field::RandomCity

Similar to RandomAddress, generates city using the [geojson](www.geojson.org/geojson-spec.html) format file. The default US/UK file chooses randomly from 300 addresses. The large data set can be downloaded from [here](www.infochimps.com/datasets/simplegeo-places-dump)

!!!ruby
anonymize('City').using FieldStrategy::RandomCity.region_US

!!!ruby
anonymize('City').using FieldStrategy::RandomCity.region_UK

!!!ruby
# get your own geo_json file and use it
anonymize('City').using FieldStrategy::RandomCity.new('my_geo_json.json')

Public Class Methods

new(file_path) click to toggle source
# File lib/strategy/field/contact/random_city.rb, line 20
def initialize file_path
  @values = DataAnon::Utils::GeojsonParser.city(file_path)
end