Sha256: ea0cddda7bc6c21631621a1614b5c56340df59f3c91d7468e53a5f888715a1bb

Contents?: true

Size: 361 Bytes

Versions: 1

Compression:

Stored size: 361 Bytes

Contents

require 'yaml'

module ZipCodes
  VERSION = '0.2.0'

  class << self
    def identify code
      db[code]
    end

    def db
      @db ||= begin
        this_file = File.expand_path(File.dirname(__FILE__))
        us_data = File.join(this_file, "data", "US.yml")
        YAML.load(File.open(us_data))
      end
    end

    def load
      db
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zip-codes-0.2.0 lib/zip-codes.rb