Module: Ziptastic

Defined in:
lib/ziptastic.rb,
lib/ziptastic/app.rb,
lib/ziptastic/version.rb

Defined Under Namespace

Classes: App, NotZipCode

Constant Summary collapse

DATABASE_PATH =
File.expand_path(File.dirname(__FILE__) + "/ziptastic/data/zipcodes.db")
ZIP_DATABASE =
SQLite3::Database.open(DATABASE_PATH, :readonly => true, :results_as_hash => true)
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.search(zip_code) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/ziptastic.rb', line 9

def self.search(zip_code)
  search_results = []
  
  search_results = search_for_zip_code(zip_code).collect do |row|
    {:city => row['city'], :state => row['state'], :country => row['country']}
  end
      
  search_results
end