Class: DataAnon::Strategy::Field::RandomAddress

Inherits:
GeojsonBase
  • Object
show all
Defined in:
lib/strategy/field/contact/random_address.rb

Overview

Generates address 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)

anonymize('Address').using FieldStrategy::RandomAddress.region_US

!!!ruby
anonymize('Address').using FieldStrategy::RandomAddress.region_UK

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

Instance Method Summary collapse

Methods inherited from GeojsonBase

#anonymize, region_UK, region_US

Constructor Details

#initialize(file_path) ⇒ RandomAddress

Returns a new instance of RandomAddress.


20
21
22
# File 'lib/strategy/field/contact/random_address.rb', line 20

def initialize file_path
  @values = DataAnon::Utils::GeojsonParser.address(file_path)
end