postcode_gem 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postcode_gem.rb +7 -2
- data/lib/postcode_gem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc78a23dd3c7fb5436238970d3b2344f9011e9c17c6e68cf659d2ed0f46bf5ac
|
4
|
+
data.tar.gz: d0ef9d082147e2a4af2ffc84cd6f4da1bfb6c23b50a55541f7f45136beacdd32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ceec948c0e15464e0dbc304f3fe8e492116560c745ad0c2dd5662cbfae160ccdc1eea96de2532853379412f9e09865f3ec0fd484454003d131fe0fbfcc393ff
|
7
|
+
data.tar.gz: 0b3449c7c19c06f5e0542889b6e0f5edcf4c8bad85ed1a4e31444990440ea8064b1ce5493b8c3a02332a569b33c428e6de1c8776997d7b8d0753cfd4a60f56d0
|
data/lib/postcode_gem.rb
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
require_relative '../lib/postcode_gem/version'
|
2
|
-
|
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 =
|
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: "
|
data/lib/postcode_gem/version.rb
CHANGED