Class: GeonamesRails::Writers::DryRun

Inherits:
Object
  • Object
show all
Defined in:
lib/geonames_rails/writers/dry_run.rb

Instance Method Summary collapse

Instance Method Details

#write_cities(country_code, city_mappings) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/geonames_rails/writers/dry_run.rb', line 16

def write_cities(country_code, city_mappings)
  raise "can't create cities without a country" unless country_code
  raise "must have a set of city mappings" unless city_mappings
  
  raise "i'm sure there should be at least 1 city in this country" if city_mappings.empty?
  
  "Dry run of country #{country_code} would have written out #{city_mappings.length} cities"
end

#write_country(country_mapping) ⇒ Object



4
5
6
7
8
# File 'lib/geonames_rails/writers/dry_run.rb', line 4

def write_country(country_mapping)
  raise "must have a of country mapping" unless country_mapping
  
  "Dry run of country #{country_mapping[:name]} should have been OK"
end

#write_division(division_mapping) ⇒ Object



10
11
12
13
14
# File 'lib/geonames_rails/writers/dry_run.rb', line 10

def write_division(division_mapping)
  raise "must have a of division mapping" unless division_mapping
  
  "Dry run of country #{division_mapping[:division_id]} should have been OK"
end