postcode_gem 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: a337904f5c26c8e959f9749a9b02cdba6913ef3e820658b6de73caa165481670
4
- data.tar.gz: '08eff51288a9e7820975bb2c9b548b880f5589c89ad91b15cc60d3bb6de29de6'
3
+ metadata.gz: 4069efa60a941b456748d14a49d3d296cea87a37bdf6ebd869be7d2e96284d54
4
+ data.tar.gz: b7619d4d6a1bc681de23bc74c0527573d6a58b375c4bd06f258376a03843d6b7
5
5
  SHA512:
6
- metadata.gz: 2239f0a1494569dcc5b13213d8ed74e31cfe940b839ba0ea0c4e29810d3ab2c26d513e5b52f848cbad08dc377bc036c95dea020c56eb9c4e3c6b967ed959afe6
7
- data.tar.gz: 84312cd6f1c81110bf773151192a3566da9112a7e8b068463585d1884e90df27ac47a1f932b9e99d15b5338ba86d16d323cc456b0a684e1747667f00cbd46c4f
6
+ metadata.gz: db484521908ddd0d4ab1cc87339a3539789e0e9fae3fb1b133c5c956f8ecad5f5598246bfe73058cc92780d675b095c88907ed58953736e5fdab91c49f4b519e
7
+ data.tar.gz: b488c9e3ceae87fb2fd5df808a58827e385b00c7bc8cc543170f74f1839e532f830fb1e31f0c72fbe0fffff4fa12441d712b583cc0a791b831afa2697191b5ae
@@ -1,3 +1,3 @@
1
1
  module PostcodeGem
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
data/lib/postcode_gem.rb CHANGED
@@ -5,8 +5,8 @@ require_relative "../lib/postcode_gem/version"
5
5
 
6
6
 
7
7
  module PostcodeGem
8
- DATA = JSON.parse(File.read('./data/postcode_areacode.json'))
9
8
  def self.select_country
9
+ @data = JSON.parse(File.read('./data/postcode_areacode.json'))
10
10
  attr_accessor :country, :city, :zipcode
11
11
  prompt = TTY::Prompt.new
12
12
  @country = prompt.select('Enter the country you want to select', %w(Vietnam England Japan))
@@ -19,9 +19,9 @@ module PostcodeGem
19
19
  end
20
20
  def output_zipcode
21
21
  process_input
22
- @city = DATA["#{@country}"].values
23
- @zipcode = DATA["#{@country}"].keys
24
- @data_country = DATA["#{@country}"]
22
+ @city = @data["#{@country}"].values
23
+ @zipcode = @data["#{@country}"].keys
24
+ @data_country = @data["#{@country}"]
25
25
 
26
26
  if @data_country.has_key?(@city_zipcode)
27
27
  puts @data_country.values_at("#{@city_zipcode}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postcode_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhuongTr1501