zip_code 0.1.3 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b6b28cab0c6a9d45c5dc7904a7b997854acc08e
4
- data.tar.gz: ec287abce0e8fd72339393a5e71cdad5f1f40630
3
+ metadata.gz: 2dc349504a99aea1126fd0a161979fe0d289fd1d
4
+ data.tar.gz: e7a0cf66fdda29f80384435983336b77cc2b0993
5
5
  SHA512:
6
- metadata.gz: 7abd5c0b7b05e71fb48644215c612100e76efd8994ca6ae5b2ce1f044f2ca91a2dca293093c20845025151a853d75268de20f85324239bdd6287216e20fc1906
7
- data.tar.gz: 3dcca9e267118299a0d1c89714d8ea0a2a5bcebc1972cfcff447c4bb70d3b6c2011af4d2965f41c4d58a033bc6cc03b621aa6a36e6ea0dbc45e7d00c836a1464
6
+ metadata.gz: 30b2e9f3ec34f13846232b388fa93834632f27f85764a80876000f16db0ad39cf51b450db7777f69847247c575e56bbc43979bada49f98df332a6470dcf59d43
7
+ data.tar.gz: 9691710c8752ee5e46a8d215c2f8d289a114b846735818452fe0f48386892c02f47f00446b86adb06236828e7a6c4dad3ddd3148180782efcd7758a2253a6ea0
data/README.md CHANGED
@@ -22,10 +22,14 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```ruby
26
+ zip_code = ZipCode.find('河北省', '邢台市')
27
+ puts zip_code # => "054000"
26
28
 
29
+ zip_code = ZipCode.find('河北省', '邢台市', '柏乡县')
30
+ puts zip_code # => "055450"
31
+ ```
27
32
  ## Development
28
-
29
33
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
34
 
31
35
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
@@ -1,3 +1,3 @@
1
1
  module ZipCode
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/zip_code.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  require "zip_code/mapping"
2
2
 
3
3
  module ZipCode
4
- def self.find region, city, district = ''
5
- return '' if ZipCode::MAPPING[region].nil?
6
- return '' if ZipCode::MAPPING[region][city].nil?
7
- return ZipCode::MAPPING[region][city].first[1] if district.empty?
8
- return ZipCode::MAPPING[region][city][district] || ''
4
+ def self.find province, city, district = ''
5
+ return '' if ZipCode::MAPPING[province].nil?
6
+ return '' if ZipCode::MAPPING[province][city].nil?
7
+ return ZipCode::MAPPING[province][city].first[1] if district.empty?
8
+ return ZipCode::MAPPING[province][city][district] || ''
9
9
  end
10
10
  end
data/zip_code.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{Write a short summary, because Rubygems requires one.}
13
13
  spec.description = %q{Write a longer description or delete this line.}
14
- spec.homepage = ""
14
+ spec.homepage = "https://github.com/kevin521024/zip_code"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zip_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - keivn
@@ -58,7 +58,7 @@ files:
58
58
  - lib/zip_code/mapping.rb
59
59
  - lib/zip_code/version.rb
60
60
  - zip_code.gemspec
61
- homepage: ''
61
+ homepage: https://github.com/kevin521024/zip_code
62
62
  licenses:
63
63
  - MIT
64
64
  metadata: