Sha256: f432b9ed2e5c376ac2dee27867ca9e39e36640b6603b61e9084fdefb39422d9e

Contents?: true

Size: 313 Bytes

Versions: 9

Compression:

Stored size: 313 Bytes

Contents

module GeonamesRails
  module Mappings
    class Base < Hash
      def initialize(line = nil)
        if line
          fields_from_line = line.split("\t")
          mappings.each do |k,v|
            self[k] = fields_from_line[v]
          end
        else
          super
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
geonames_rails-0.2.2 lib/geonames_rails/mappings/base.rb
geonames_rails-0.2.1 lib/geonames_rails/mappings/base.rb
geonames_rails-0.2.0 lib/geonames_rails/mappings/base.rb
geonames_rails-0.1.6 lib/geonames_rails/mappings/base.rb
geonames_rails-0.1.5 lib/geonames_rails/mappings/base.rb
geonames_rails-0.1.3 lib/geonames_rails/mappings/base.rb
geonames_rails-0.1.2 lib/geonames_rails/mappings/base.rb
geonames_rails-0.1.1 lib/geonames_rails/mappings/base.rb
geonames_rails-0.1.0 lib/geonames_rails/mappings/base.rb