Class: DataAnon::Strategy::Field::GeojsonBase

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ GeojsonBase


14
15
16
# File 'lib/strategy/field/contact/geojson_base.rb', line 14

def initialize file_path
  raise "Load and set the @values member variable in constructor"
end

Class Method Details

.region_UKObject


10
11
12
# File 'lib/strategy/field/contact/geojson_base.rb', line 10

def self.region_UK
  self.new DataAnon::Utils::Resource.file('UK_addresses.geojson')
end

.region_USObject


6
7
8
# File 'lib/strategy/field/contact/geojson_base.rb', line 6

def self.region_US
  self.new DataAnon::Utils::Resource.file('US_addresses.geojson')
end

Instance Method Details

#anonymize(field) ⇒ Object


18
19
20
# File 'lib/strategy/field/contact/geojson_base.rb', line 18

def anonymize field
  @values.sample
end