apiverve_callingcode 1.2.4 → 1.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 +4 -4
- data/README.md +40 -4
- data/lib/apiverve_callingcode/client.rb +2 -2
- data/lib/apiverve_callingcode.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5689b53c1a991c763cd09e648f2adfd0b2e24c78cf6c9c294a0f139921cb4e80
|
|
4
|
+
data.tar.gz: 5da119eac872e3ecc6bf72904927ff66e393ba9b8d3f169aeec5070a99aa117a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b6625fb6c69944f1c3680bfb67b268fca1c20839735a5ff91c9a39c48fb54925e7c6a55581a63517ed50de2324e132d6fcfe1f6173ed9d29d87fa4e49c1c1222
|
|
7
|
+
data.tar.gz: 87404706e67053f68402f09fdfdaa37c438a29ee5f1d317141f4fe8ea0a84c9d0bb2502e8c6760e6fda0181f6b8520e43114938bf7d518f252047e7d938dabd8
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Country Calling Code API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Country Calling Code is a phone number country code API that looks up international dialing codes and official names from a two-letter ISO country code. It returns an array of calling prefixes and
|
|
3
|
+
Country Calling Code is a phone number country code API that looks up international dialing codes and official names from a two-letter ISO country code. It returns an array of calling prefixes, standard country identifiers and, on request, the country's exit and trunk prefixes, other regions sharing its code, valid number lengths and example numbers by line type.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -35,7 +35,10 @@ require 'apiverve_callingcode'
|
|
|
35
35
|
client = APIVerve::Callingcode::Client.new(api_key: "YOUR_API_KEY")
|
|
36
36
|
|
|
37
37
|
# Make a request
|
|
38
|
-
response = client.execute({
|
|
38
|
+
response = client.execute({
|
|
39
|
+
country: "FR",
|
|
40
|
+
dialing: true
|
|
41
|
+
})
|
|
39
42
|
|
|
40
43
|
# Print the response
|
|
41
44
|
puts response
|
|
@@ -46,7 +49,7 @@ puts response
|
|
|
46
49
|
|
|
47
50
|
```ruby
|
|
48
51
|
begin
|
|
49
|
-
response = client.execute({ country: "FR" })
|
|
52
|
+
response = client.execute({ country: "FR", dialing: true })
|
|
50
53
|
puts response["data"]
|
|
51
54
|
rescue APIVerve::Callingcode::ValidationError => e
|
|
52
55
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -80,7 +83,40 @@ client = APIVerve::Callingcode::Client.new(
|
|
|
80
83
|
"+33"
|
|
81
84
|
],
|
|
82
85
|
"region": "Europe",
|
|
83
|
-
"subregion": "Western Europe"
|
|
86
|
+
"subregion": "Western Europe",
|
|
87
|
+
"dialing": {
|
|
88
|
+
"internationalPrefix": "00",
|
|
89
|
+
"nationalPrefix": "0",
|
|
90
|
+
"sharedWith": [],
|
|
91
|
+
"possibleLengths": {
|
|
92
|
+
"fixedLine": [
|
|
93
|
+
9
|
|
94
|
+
],
|
|
95
|
+
"mobile": [
|
|
96
|
+
9
|
|
97
|
+
],
|
|
98
|
+
"tollFree": [
|
|
99
|
+
9
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"exampleNumbers": {
|
|
103
|
+
"fixedLine": {
|
|
104
|
+
"international": "+33 1 23 45 67 89",
|
|
105
|
+
"national": "01 23 45 67 89",
|
|
106
|
+
"e164": "+33123456789"
|
|
107
|
+
},
|
|
108
|
+
"mobile": {
|
|
109
|
+
"international": "+33 6 12 34 56 78",
|
|
110
|
+
"national": "06 12 34 56 78",
|
|
111
|
+
"e164": "+33612345678"
|
|
112
|
+
},
|
|
113
|
+
"tollFree": {
|
|
114
|
+
"international": "+33 801 23 45 67",
|
|
115
|
+
"national": "0 801 23 45 67",
|
|
116
|
+
"e164": "+33801234567"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
84
120
|
}
|
|
85
121
|
}
|
|
86
122
|
```
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Callingcode::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ country: "FR" })
|
|
13
|
+
# response = client.execute({ country: "FR", dialing: true })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/callingcode?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 2 } }
|
|
22
|
+
VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 2 }, 'dialing' => { type: 'boolean', required: false } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
data/lib/apiverve_callingcode.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_callingcode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -59,7 +59,9 @@ dependencies:
|
|
|
59
59
|
version: '2.0'
|
|
60
60
|
description: Country Calling Code is a phone number country code API that looks up
|
|
61
61
|
international dialing codes and official names from a two-letter ISO country code.
|
|
62
|
-
It returns an array of calling prefixes
|
|
62
|
+
It returns an array of calling prefixes, standard country identifiers and, on request,
|
|
63
|
+
the country's exit and trunk prefixes, other regions sharing its code, valid number
|
|
64
|
+
lengths and example numbers by line type.
|
|
63
65
|
email:
|
|
64
66
|
- hello@apiverve.com
|
|
65
67
|
executables: []
|