postcode_gem 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63e56495470c999b6a37bd619eb97a8c6272c8636d6451134eccb7d109b10f1d
4
- data.tar.gz: ae1c19704a9bbf6026a98795ef3aba31010077b0c551e7ea4a31a4ed08063936
3
+ metadata.gz: 9b00375de3e1473e9331437c2d267a7cf5a46e20f07c4dbc13612c14eaa73781
4
+ data.tar.gz: cb8371b43f62e7808d3c61245adb45798eda618e940b437fb3296b61c14977d9
5
5
  SHA512:
6
- metadata.gz: cefa6d0d888e4b0823662c9d8143d5b3a735079b11b9ab3ad33d4294c932cf238c8e75bc5af8f349113fa0616ee63370a4843cd974e6b0a3114d048ca292c9ee
7
- data.tar.gz: 897c0654f9b731457e9c99b4a1f85ef079bb57614308e9561827d4433e30c106fa934aa222dd2a27df6fa4fd2d6aad4c9791ed8a7810a71964a62726d63dd3a4
6
+ metadata.gz: 28b9128bcb9a9063abb103c2115ee3bb9445b7b3452643389181dcdad9f6615f13d1df34f3750c29944c2b66e9095ae266b4fb3a029bb05be83ae7f579d7b7ea
7
+ data.tar.gz: a8bad1ab419432c941151d33a10770926643e97de9adfe975bc48577ad9ad1c1fb5563de81822ac12ace0e83f80537dd12e67cfdbfa0349cce9ee99de84f5f54
@@ -4,20 +4,14 @@ require "tty-prompt"
4
4
  require "pry"
5
5
 
6
6
  module PostcodeGem
7
- def self.select_country
7
+ attr_accessor :country, :city, :zipcode
8
+ def output_zipcode
8
9
  @data = JSON.load(File.read('./data/postcode_areacode.json'))
9
- attr_accessor :country, :city, :zipcode
10
10
  prompt = TTY::Prompt.new
11
11
  @country = prompt.select('Enter the country you want to select', %w(Vietnam England Japan))
12
- end
13
- def self.process_input
14
- select_country
15
12
  print "Enter the city or area code you want to search: "
16
13
  @city_zipcode = gets.chomp
17
14
  @firstWord = @city_zipcode.split('')[0]
18
- end
19
- def output_zipcode
20
- process_input
21
15
  @city = @data["#{@country}"].values
22
16
  @zipcode = @data["#{@country}"].keys
23
17
  @data_country = @data["#{@country}"]
@@ -35,3 +29,12 @@ module PostcodeGem
35
29
  end
36
30
  module_function :output_zipcode
37
31
  end
32
+
33
+ class Show
34
+ include PostcodeGem
35
+ def call_result
36
+ output_zipcode
37
+ end
38
+ end
39
+ a = Show.new.call_result
40
+ puts a
@@ -1,3 +1,3 @@
1
1
  module PostcodeGem
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
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.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhuongTr1501