freshdesk-rest 0.0.1 → 0.1.0

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
  SHA256:
3
- metadata.gz: c4dba7609ed11098e454c7df3efed04ce87562d4dd155a41f0cb3fe61132c8bc
4
- data.tar.gz: c5a1782f15f2a4d6d9d843dfd32a32f8bc2c3033aab4b633835f7645344aad4d
3
+ metadata.gz: c74123eb5c07012c97676484ee6108c47107f0cda0f957efb5879f7261eef3ed
4
+ data.tar.gz: 9eb577566814c58629699b870e44ce2400d3cb5248731a697d1945474a5ba0a1
5
5
  SHA512:
6
- metadata.gz: 54824fb46ebf235ecfbd4bd9a9b29e4a40f149a7f4e5515cbe1671ad87e9879e819a21c6b17c1f4c1fc56abf37d3ab8bc5203a3b0aa0f29f11b7f432edefa511
7
- data.tar.gz: e262751269bdbfa9eedc23faf475089b53a05e40292d913ce9ce2c0a1eb682ae649070a90366e515210f5e687e5d953bb51e2ff6ab647824d6f6060ae22d303c
6
+ metadata.gz: d6086003c53dc44115635ab05f0a2bba4c0427757a598c6fb07fb0a9ec1653efc9434b1cb83bc946f9044ce8f06dfde7975b93fa88273e9e25f9ca28be085370
7
+ data.tar.gz: ab148eaf62ab0fde40df14fdc75da967d19b8e339097703f1a9cdda34733fb1e29d4cf0856406333533deb49f6aeb92a85489ae6b8a2e8a566f2462c02d05a73
@@ -10,9 +10,7 @@ module Freshdesk
10
10
  end
11
11
 
12
12
  def list(params: {})
13
- query = URI.encode_www_form(params.to_a)
14
- path = [@path, (query.empty? ? nil : query)].compact.join('?')
15
- Parser.parse(@client.get(path))
13
+ Parser.parse(@client.get([@path, presence(query(params))].compact.join('?')))
16
14
  end
17
15
 
18
16
  def get(id:)
@@ -30,6 +28,16 @@ module Freshdesk
30
28
  def delete(id:)
31
29
  Parser.parse(@client.delete("#{@path}/#{id}"))
32
30
  end
31
+
32
+ private
33
+
34
+ def presence(value)
35
+ value.empty? ? nil : value
36
+ end
37
+
38
+ def query(params)
39
+ URI.encode_www_form(params.to_a)
40
+ end
33
41
  end
34
42
  end
35
43
  end
@@ -1,5 +1,5 @@
1
1
  module Freshdesk
2
2
  module Rest
3
- VERSION = '0.0.1'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freshdesk-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Placzyński
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-10 00:00:00.000000000 Z
11
+ date: 2019-01-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A ruby gem to interact with Freshdesk REST resources
14
14
  email: placzynski.pawel@gmail.com
@@ -27,7 +27,7 @@ homepage: https://rubygems.org/gems/freshdesk-rest
27
27
  licenses:
28
28
  - MIT
29
29
  metadata:
30
- source_code_uri: https://github.com/placek/freshdesk-rest
30
+ source_code_uri: https://github.com/Helpling/freshdesk-rest
31
31
  post_install_message:
32
32
  rdoc_options: []
33
33
  require_paths: