Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/tzip/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module ClassMethods
def find_by_zipcode(zipcode)
[5,4,3,2,1].each do |i|
return MAPPING[zipcode.to_s[0,i]] if MAPPING.has_key?(zipcode.to_s[0,i])
end
end
return nil
end
end
end
end
2 changes: 1 addition & 1 deletion lib/tzip/values/central.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TZip
ZONINGS[:central] = %w{35 36 370 3720 3723 381 383 39 }
ZONINGS[:central] += %w{4641}
ZONINGS[:central] += %w{4641 49801 49812 49815 49821 49831 49834 49847 49858 49873 49874 49881 49887 49892 49893 49896 49920 49935 49938 49947 49968 49969 }
ZONINGS[:central] += %w{50 51 52 53 54 55 56 57 581 582 585 }
ZONINGS[:central] += %w{60 61 62 63 64 65 660 661 6660 672 680 681 685}
ZONINGS[:central] += %w{7}
Expand Down
2 changes: 1 addition & 1 deletion lib/tzip/values/eastern.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TZip
ZONINGS[:eastern] = %w{0 1 2}
ZONINGS[:eastern] += %w{30 31 32 33 34 376 379 398 399}
ZONINGS[:eastern] += %w{402 405 410 43 44 45 460 462 462 480 481 482 483 485 488 489 490 495 496 }
ZONINGS[:eastern] += %w{402 405 410 43 44 45 460 462 462 480 481 482 483 484 485 488 489 490 495 496 499}
ZONINGS[:eastern] += %w{569}
end
4 changes: 2 additions & 2 deletions spec/tzip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}

# Central
%w(37013 38104 38138 38301 60629 66062 67214 58103 58201 58501 66606 68510).each{|zip|
%w(37013 38104 38138 38301 49801 49812 49815 49821 49831 49834 49847 49858 49873 49874 49881 49887 49892 49893 49896 49920 49935 49938 49968 49969 60629 66062 67214 58103 58201 58501 66606 68510).each{|zip|
it { print zip; lookup_zip(zip).should == 'Central Time (US & Canada)' }
}

# Eastern
%w(00926 08701 11226 23464 28269 30043 30044 48201 48109 32308 37604 37917 32207 32216 41017 40502 46032 48124 48197 48307 48532 48912 49008 49546 49684 48503 ).each{|zip|
%w(00926 08701 11226 23464 28269 30043 30044 48201 48430 48109 32308 37604 37917 32207 32216 41017 40502 46032 48124 48197 48307 48532 48912 49008 49925 49546 49684 48503 ).each{|zip|
it { print zip; lookup_zip(zip).should == 'Eastern Time (US & Canada)' }
}

Expand Down