telphin_api 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69a4a2fd5800ff1c376f7f3cfae3c1122503769e
4
- data.tar.gz: b5a42d1bf6295d237dc79eda46f5e0cdb2021e17
3
+ metadata.gz: 28aa864db5f15510bd7752fb3b29435af49e5a7c
4
+ data.tar.gz: 68aae21d0cc704d087c145ce3f0727a73a2465c5
5
5
  SHA512:
6
- metadata.gz: 650c818828bc06ad7acac0e6b9026aeb9f4ca1e754d1ce97bcfcbcfd5c95f82f213626dc81b937067e7e151ecc948c90ba1798f7a3c05ff9b8981b69fdcc4157
7
- data.tar.gz: 73a918bb9f90c4c4d647aa783ff8783ada880e0e582d8cb3421e3a1b5e3627ec5473e8e15f8a84a9af2c28000413e3d788c30b87a1ebcc1e04ff95954e0f16eb
6
+ metadata.gz: d01f58d078d52ff931a28e54060bbe8c2b319fd2ba8db58b923f71f3874be9b815df27f5f4059ef213824a7912c68ecf2bb22bde031ea23e83c191de9268dd3e
7
+ data.tar.gz: 7f365967d6626a4095b96a4d94ed53ccc7d13bbddb47f8b11d52966d83364787e83ad6e8b4ba3e4770568c3a5f76fbd01f3aba74b8ed7c27a8b6db3294a5a100
@@ -24,7 +24,7 @@ module TelphinApi
24
24
  url = url + '/' + id unless id.nil?
25
25
 
26
26
  flat_arguments = Utils.flatten_arguments(args)
27
- flat_arguments = flat_arguments.to_json.to_s if http_method == :post
27
+ flat_arguments = flat_arguments.to_json.to_s if [:post, :put].include? http_method
28
28
 
29
29
  connection(url: TelphinApi.site, token: token, method: http_method).send(http_method, url, flat_arguments).body
30
30
  end
@@ -41,9 +41,7 @@ module TelphinApi
41
41
 
42
42
  Faraday.new(url, TelphinApi.faraday_options) do |builder|
43
43
  builder.headers['Authorization'] = "Bearer #{token}"
44
- if method == :post
45
- builder.headers['Content-Type'] = 'application/json'
46
- end
44
+ builder.headers['Content-Type'] = 'application/json' if [:post, :put].include? method
47
45
 
48
46
  builder.request :multipart
49
47
  builder.request :url_encoded
@@ -1,4 +1,4 @@
1
1
  module TelphinApi
2
2
  # Library version.
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telphin_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyutyunnikov Konstantin