isd_code 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/lib/isd.yaml +17 -0
  3. data/lib/isd_code.rb +29 -0
  4. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ad56fcf7e10b929f1e0f80e442520b794501c07f
4
+ data.tar.gz: f04e4548065dabb15d873ffb4a622da243e6925d
5
+ SHA512:
6
+ metadata.gz: 638648f240f17faf8ab25769d3ff9d19ae85224df9a38684d75b36b503314f780e539c7fb5afc70b9af80fba23d640f3cdc40a6cce0e1f99853fb5b53965866a
7
+ data.tar.gz: d2bbe4905607d9c99efe45a659c69b7be642baea247549d0277fa93cd695bcc1142e4941b3f04639c775fa9156f14976cce703f34d0007c3c6ac9d9f56d82820
@@ -0,0 +1,17 @@
1
+ afghanistan: "93"
2
+ albania: "355"
3
+ algeria: "213"
4
+ american_samoa: "684"
5
+ andorra: "376"
6
+ angola: "244"
7
+ anguilla: "1"
8
+ antigua_and_barbuda: "1"
9
+ argentine_republic: "54"
10
+ armenia: "374"
11
+ aruba: "297"
12
+ ascension: "247"
13
+ australia: "61"
14
+ australian_external_territories: "672"
15
+ austria: "43"
16
+ azerbaijani_republic: "994"
17
+
@@ -0,0 +1,29 @@
1
+ require 'yaml'
2
+ module IsdCode
3
+ flag_file = "/Users/deekshita.a.k/Documents/isd_code/lib/isd.yaml"
4
+ @@config = YAML::load_file(flag_file)
5
+
6
+ def self.custom_yaml_file_path(file)
7
+ @@config = YAML::load_file(file)
8
+ end
9
+
10
+ def self.code(name = nil)
11
+ if name.nil?
12
+ puts "Enter country name or ISD code"
13
+ name = gets.chomp
14
+ end
15
+ value = @@config[name.to_s.downcase]
16
+ if value.nil?
17
+ if @@config.key(name).nil?
18
+ return "Enable to find results"
19
+ else
20
+ return @@config.key(name)
21
+ end
22
+ else
23
+ return value
24
+ end
25
+ end
26
+
27
+ end
28
+
29
+
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: isd_code
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Deekshita KV
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - deekshita.kamble@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/isd.yaml
21
+ - lib/isd_code.rb
22
+ homepage:
23
+ licenses: []
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.4.8
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Look up for the country isd codes and visa versa!
45
+ test_files: []