tenios-api 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tenios/api/number.rb +10 -5
- data/lib/tenios/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0911331d2acc593d17afe8263e9955e9b0e7ce82d632b09c5d9586a23eff13
|
4
|
+
data.tar.gz: 7d2d7ca7ec66d8b21a0ffda096a293a1e1305b7e6824300515741ba5f032d1eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02334eb4c0304b31227505016987ac23a42f2ac66610c8799d26dfe6ec7abb4231310c700447b85294ab22afba07473802561ab9e06aeeb5357cea7ecebe818f
|
7
|
+
data.tar.gz: 9dc6a38fd7dea49f3686ba45dc3ca09946bfdf1ec9f8353b9158b57dd8b1706604705ad0abfedc4468927f8397f041c096dbb7a991734783291c4765c9564b3a
|
data/Gemfile.lock
CHANGED
data/lib/tenios/api/number.rb
CHANGED
@@ -14,24 +14,29 @@ module Tenios
|
|
14
14
|
].freeze
|
15
15
|
|
16
16
|
def order(verification_id:, number_type: GEOGRAPHICAL, **options)
|
17
|
-
payload =
|
17
|
+
payload = order_payload(verification_id: verification_id, number_type: number_type, **options)
|
18
18
|
client.http_client.post('/number/order', payload).body
|
19
19
|
end
|
20
20
|
|
21
|
+
def cancel(phone_number:)
|
22
|
+
payload = { access_key: client.access_key, phone_number: phone_number }
|
23
|
+
client.http_client.post('/number/cancel', payload).body
|
24
|
+
end
|
25
|
+
|
21
26
|
private
|
22
27
|
|
23
|
-
|
28
|
+
ORDER_OPTIONS = %i[
|
24
29
|
link_to_number
|
25
30
|
number_type
|
26
31
|
push_secret
|
27
32
|
push_url
|
28
33
|
verification_id
|
29
34
|
].freeze
|
30
|
-
private_constant :
|
35
|
+
private_constant :ORDER_OPTIONS
|
31
36
|
|
32
|
-
def
|
37
|
+
def order_payload(**options)
|
33
38
|
options
|
34
|
-
.slice(*
|
39
|
+
.slice(*ORDER_OPTIONS)
|
35
40
|
.merge(access_key: client.access_key)
|
36
41
|
end
|
37
42
|
end
|
data/lib/tenios/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenios-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carwow Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|