postcode_gem 0.3.8 → 0.3.13

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: 0cbccb1683d859ebfaf71f7ac55e7f2b855f17d4ad81219c4ecc29f02fe194dd
4
- data.tar.gz: '09d8345891920fa038a3ff246feed9ceb0ed9cee6f26eef36485c835a7ad83c3'
3
+ metadata.gz: fc78a23dd3c7fb5436238970d3b2344f9011e9c17c6e68cf659d2ed0f46bf5ac
4
+ data.tar.gz: d0ef9d082147e2a4af2ffc84cd6f4da1bfb6c23b50a55541f7f45136beacdd32
5
5
  SHA512:
6
- metadata.gz: 6861b20678fb4c8de88b2f566eba37f0c696d90d3f70cc6d5f0497a4ee5edb16899da9e6ff08d8073436473af8eadafb30fca49adf77304c7a1fca5a630b3d7a
7
- data.tar.gz: 7a53b2487b63de8a2a4e74ddc24e33818b6f1e6807e029d30aeeaa01927753d7e72069779b89ddccc7dfe7b4b37988253d9e0de09de1dff72eea3d6c55323573
6
+ metadata.gz: 7ceec948c0e15464e0dbc304f3fe8e492116560c745ad0c2dd5662cbfae160ccdc1eea96de2532853379412f9e09865f3ec0fd484454003d131fe0fbfcc393ff
7
+ data.tar.gz: 0b3449c7c19c06f5e0542889b6e0f5edcf4c8bad85ed1a4e31444990440ea8064b1ce5493b8c3a02332a569b33c428e6de1c8776997d7b8d0753cfd4a60f56d0
@@ -1,12 +1,17 @@
1
1
  require_relative '../lib/postcode_gem/version'
2
- require "json"
2
+ require 'json'
3
3
  require "tty-prompt"
4
4
  require "pry"
5
5
 
6
6
  module PostcodeGem
7
7
  attr_accessor :country, :city, :zipcode
8
+ module_function
9
+ def export_json
10
+ PostcodeGem::Export.execute
11
+ end
12
+
8
13
  def output_zipcode
9
- @data = JSON.load(File.read("#{Dir.pwd}/data/postcode_areacode.json"))
14
+ @data = JSON.parse(File.open('data/postcode_areacode.json').read)
10
15
  prompt = TTY::Prompt.new
11
16
  @country = prompt.select('Enter the country you want to select', %w(Vietnam England Japan))
12
17
  print "Enter the city or area code you want to search: "
@@ -37,4 +42,3 @@ class Show
37
42
  end
38
43
  end
39
44
 
40
- Show.new.call_result
@@ -1,3 +1,3 @@
1
1
  module PostcodeGem
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.13"
3
3
  end
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.3.8
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhuongTr1501