postal_codes 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/README.md +15 -2
- data/lib/data/usa.yml +43621 -0
- data/lib/postal_codes/version.rb +1 -1
- data/lib/postal_codes.rb +5 -3
- metadata +4 -3
- data/postal_codes-0.0.1.gem +0 -0
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# PostalCodes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A gem to provide details related to postal code(country, state, locality, calling_code, country_code).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Currently it is having data only for India and USA.I will be updating for more countries as well
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
@@ -18,7 +21,17 @@ Or install it yourself as:
|
|
|
18
21
|
|
|
19
22
|
## Usage
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
To Find information of postal code :
|
|
25
|
+
|
|
26
|
+
PostalCodes.find_all(110094)
|
|
27
|
+
|
|
28
|
+
It will return the array of Hash:
|
|
29
|
+
|
|
30
|
+
[{"country"=>{"name"=>"India", "calling_code"=>"+91", "alpha_2_code"=>"IN", "alpha_3_code"=>"IND", "numeric_code"=>"356"}, "state"=>"DELHI", "locality"=>"New Delhi"}]
|
|
31
|
+
|
|
32
|
+
In rare case if a postal code present in more than one country then it will display result as follows :
|
|
33
|
+
|
|
34
|
+
[{"country"=>{"name"=>"India", "calling_code"=>"+91", "alpha_2_code"=>"IN", "alpha_3_code"=>"IND", "numeric_code"=>"356"},"state"=>"DELHI", "locality"=>"New Delhi"}, {"country"=>{"name"=>"USA","calling_code"=>"+1","alpha_2_code"=>"US", "alpha_3_code"=>"USA", "numeric_code"=>"840"},"state"=>"Alabama", "locality"=>"Moody"}]
|
|
22
35
|
|
|
23
36
|
## Contributing
|
|
24
37
|
|