nexmo 5.0.0 → 5.0.1

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
  SHA1:
3
- metadata.gz: 0b38195a5f7b45532e348dfbfae76723a0811079
4
- data.tar.gz: 20cb3bfa9baaba751385129f20f800377904da8e
3
+ metadata.gz: 315e374cd8f45d02cc74f027820f3baa7171206d
4
+ data.tar.gz: e6ce98ae4cb4c2924c2cf113730c4c2320ba56e8
5
5
  SHA512:
6
- metadata.gz: 4c565d0ad05cbba41f77fb4d5b5f459f32d31d8db7bf2835ce799ec6b8be4e406aa71a8e5e0cd9ab67fca4607d766716dc22f1f78ff3eccf6278ff4b75ec41b2
7
- data.tar.gz: 706b07b7dda466dde0c9372471eb4d8221ebf207485fdfb2f49f119c5b05b7b7902038270a97f223c9b8516ab1a2cc93057c46bb849baf4fb108b36ca7d1153e
6
+ metadata.gz: 45c33722d8569ae134d2c74e304de846831a52c8576bf561729b93ff58c6d6cb8806c7fc033cc41e5054521cb979279f21769a6bce6a812ee646d2725deeae02
7
+ data.tar.gz: 678e56aff509db8cd86d65fe60ab38903f29d7729d45d47ac8a3da1552022610acbcddd4d8b0daeb221e2048522595f38c68f53e89fed5890bd3b42f2d231a6c
@@ -11,5 +11,9 @@ module Nexmo
11
11
  def authorization_header?
12
12
  true
13
13
  end
14
+
15
+ def json_body?
16
+ true
17
+ end
14
18
  end
15
19
  end
@@ -15,5 +15,9 @@ module Nexmo
15
15
  def authorization_header?
16
16
  true
17
17
  end
18
+
19
+ def json_body?
20
+ true
21
+ end
18
22
  end
19
23
  end
@@ -15,5 +15,9 @@ module Nexmo
15
15
  def authorization_header?
16
16
  true
17
17
  end
18
+
19
+ def json_body?
20
+ true
21
+ end
18
22
  end
19
23
  end
data/lib/nexmo/calls.rb CHANGED
@@ -64,5 +64,9 @@ module Nexmo
64
64
  def authorization_header?
65
65
  true
66
66
  end
67
+
68
+ def json_body?
69
+ true
70
+ end
67
71
  end
68
72
  end
@@ -22,6 +22,10 @@ module Nexmo
22
22
  false
23
23
  end
24
24
 
25
+ def json_body?
26
+ false
27
+ end
28
+
25
29
  def request(path, params: nil, type: Get, &block)
26
30
  uri = URI('https://' + host + path)
27
31
 
@@ -38,8 +42,12 @@ module Nexmo
38
42
  message = type.new(uri.request_uri)
39
43
 
40
44
  if type::REQUEST_HAS_BODY
41
- message['Content-Type'] = 'application/json'
42
- message.body = JSON.generate(params)
45
+ if json_body?
46
+ message['Content-Type'] = 'application/json'
47
+ message.body = JSON.generate(params)
48
+ else
49
+ message.form_data = params
50
+ end
43
51
  end
44
52
 
45
53
  message['Authorization'] = @client.authorization if authorization_header?
data/lib/nexmo/numbers.rb CHANGED
@@ -4,7 +4,7 @@ module Nexmo
4
4
  class Numbers < Namespace
5
5
  include Keys
6
6
 
7
- def list(params)
7
+ def list(params = nil)
8
8
  request('/account/numbers', params: params)
9
9
  end
10
10
 
data/lib/nexmo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nexmo
2
- VERSION = '5.0.0'
2
+ VERSION = '5.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-14 00:00:00.000000000 Z
11
+ date: 2018-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt