Sha256: bb6a5673254b121515fcbf7635b5c940370277625640ff2506a0bd3b32528f00

Contents?: true

Size: 922 Bytes

Versions: 3

Compression:

Stored size: 922 Bytes

Contents

module GeonamesRails
  module Writers
    class DryRun
      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
      
      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

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geonames_rails-0.2.2 lib/geonames_rails/writers/dry_run.rb
geonames_rails-0.2.1 lib/geonames_rails/writers/dry_run.rb
geonames_rails-0.2.0 lib/geonames_rails/writers/dry_run.rb