geoinfo 0.0.3 → 0.0.4

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/README.md CHANGED
@@ -47,10 +47,17 @@ Or install it yourself as:
47
47
  '713301'.to_region(:state => true) #=> West Bengal
48
48
  '713301'.to_region(:district => true) #=> Burdwan
49
49
  '713301'.to_region(:country => true) #=> India
50
+ '713301'.to_region(:state_code => true) #=> WB
51
+
52
+ ### Convert a zip code to a STATE
53
+
50
54
  '713301'.to_region(:lat => true) #=> 23.6306
51
55
  '713301'.to_region(:log => true) #=> 87.1196
52
- '713301'.to_region(:state_code => true) #=> WB
53
-
56
+
57
+ ### Convert a place to a zip code
58
+ 'Asansol Bazar'.to_region.to_zip #=> 713301
59
+ 'Mahil Gaila'.to_region.to_zip #=> 144506
60
+
54
61
  ## Contributing
55
62
 
56
63
  1. Fork it
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["diatm.pravin.it.07.27@gmail.com"]
11
11
  gem.description = %q{find geo info}
12
12
  gem.summary = %q{find geo info}
13
- # gem.homepage = "https://github.com/diatmpravin/geoinfo.git"
13
+ gem.homepage = "https://github.com/diatmpravin/geoinfo.git"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -23,4 +23,12 @@ class String
23
23
  @region || nil
24
24
  end
25
25
 
26
+ def to_zip
27
+ @zip_codes = []
28
+ Geoinfo::ZIP_CODES.each do |row|
29
+ @zip_codes.push(row[1]) if row[2].chomp == self.chomp
30
+ end
31
+ @zip_codes.length == 1 ? @zip_codes.first : @zip_codes
32
+ end
33
+
26
34
  end
@@ -1,3 +1,3 @@
1
1
  module Geoinfo
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -45,7 +45,7 @@ files:
45
45
  - lib/geoinfo/string.rb
46
46
  - lib/geoinfo/version.rb
47
47
  - spec/spec_helper.rb
48
- homepage:
48
+ homepage: https://github.com/diatmpravin/geoinfo.git
49
49
  licenses: []
50
50
  post_install_message:
51
51
  rdoc_options: []